;                                                         -*-Scheme-*-
;;;
;;; Common init file for gaf
;;;

(use-modules (lepton library)
             (lepton log-rotate)
             ;; Import deprecated Scheme functions.
             (geda deprecated-config)
             (geda deprecated)
             (lepton color-map))

;;; The following global variables are defined in (lepton rc).
;;; All of them are deprecated, please avoid using them:
;
; path-sep       -- system path separator
; geda-data-path -- path to gEDA system-wide data directory
; geda-rc-path   -- path to gEDA system-wide config directory

;; Set some flags to aid in debugging rc files
(cond-expand (guile-2 #t)
             (guile (debug-enable 'debug)))
(debug-enable 'backtrace)
(read-enable 'positions)

; Clean up logfiles:
;
(cleanup-old-logs!)


; Function: scheme-directory( dir )
;
; Allows additional directories to be added to the list
; of directories which are used by Lepton EDA to load Scheme code.
; Environment variables in 'dir' are expanded.


;;;; Color maps
;; Load up a color scheme for printing optimised for a white background.
; Comment out the second line and comment in the first line for a
; dark background. The dark background is the original look.
;
;(load (build-path geda-rc-path "print-colormap-darkbg")) ; dark background
(primitive-load (build-path geda-rc-path "print-colormap-lightbg")) ; light background


;;;; Process configuration script directory

;; The directory containing any extra scheme files to load
(define autoload-path (build-path geda-data-path "scheme" "autoload"))

;; Execute any scheme files found in the autoload-path directory.
(load-scheme-dir autoload-path)
