diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-09-11 22:01:14 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-09-11 22:01:14 +0200 |
commit | d5dfd349a4126324ff5fb41a2c20edf8725edda9 (patch) | |
tree | 37d4d2599a47cf09240f58b1f32743e7d7c24b37 | |
parent | bf4b717791be199ce21a0c36b4b7baf3f8511f66 (diff) | |
download | geiser-chez-d5dfd349a4126324ff5fb41a2c20edf8725edda9.tar.gz geiser-chez-d5dfd349a4126324ff5fb41a2c20edf8725edda9.tar.bz2 |
Reload: we now remember user customizations and restore them during geiser-reload.
-rw-r--r-- | elisp/geiser-autodoc.el | 6 | ||||
-rw-r--r-- | elisp/geiser-custom.el | 17 | ||||
-rw-r--r-- | elisp/geiser-edit.el | 2 | ||||
-rw-r--r-- | elisp/geiser-guile.el | 8 | ||||
-rw-r--r-- | elisp/geiser-impl.el | 7 | ||||
-rw-r--r-- | elisp/geiser-mode.el | 6 | ||||
-rw-r--r-- | elisp/geiser-plt.el | 6 | ||||
-rw-r--r-- | elisp/geiser-reload.el | 5 | ||||
-rw-r--r-- | elisp/geiser-repl.el | 14 |
9 files changed, 45 insertions, 26 deletions
diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el index 4ecb8d9..5d8e35c 100644 --- a/elisp/geiser-autodoc.el +++ b/elisp/geiser-autodoc.el @@ -32,17 +32,17 @@ 'font-lock-function-name-face geiser-autodoc "highlighting procedure name in autodoc messages") -(defcustom geiser-autodoc-delay 0.3 +(geiser-custom--defcustom geiser-autodoc-delay 0.3 "Delay before autodoc messages are fetched and displayed, in seconds." :type 'number :group 'geiser-autodoc) -(defcustom geiser-autodoc-display-module-p t +(geiser-custom--defcustom geiser-autodoc-display-module-p t "Whether to display procedure module in autodoc strings." :type 'boolean :group 'geiser-autodoc) -(defcustom geiser-autodoc-procedure-name-format "%s:%s" +(geiser-custom--defcustom geiser-autodoc-procedure-name-format "%s:%s" "Format for displaying module and procedure name, in that order, when `geiser-autodoc-display-module-p' is on." :type 'string diff --git a/elisp/geiser-custom.el b/elisp/geiser-custom.el index 0b3460f..bdaac06 100644 --- a/elisp/geiser-custom.el +++ b/elisp/geiser-custom.el @@ -41,5 +41,22 @@ +;;; Reload support: + +(defvar geiser-custom--memoized-vars nil) + +(defmacro geiser-custom--defcustom (name &rest body) + `(progn + (add-to-list 'geiser-custom--memoized-vars ',name) + (defcustom ,name ,@body))) + +(defun geiser-custom--memoized-state () + (let ((result)) + (dolist (name geiser-custom--memoized-vars result) + (when (boundp name) + (push (cons name (symbol-value name)) result))))) + + + (provide 'geiser-custom) ;;; geiser-custom.el ends here diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el index 156493a..629db8b 100644 --- a/elisp/geiser-edit.el +++ b/elisp/geiser-edit.el @@ -22,7 +22,7 @@ ;;; Customization: (defmacro geiser-edit--define-custom-visit (var group doc) - `(defcustom ,var nil + `(geiser-custom--defcustom ,var nil ,doc :group ',group :type '(choice (const :tag "Other window" window) diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el index 489dc63..849fabf 100644 --- a/elisp/geiser-guile.el +++ b/elisp/geiser-guile.el @@ -25,7 +25,7 @@ "Customization for Geiser's Guile flavour." :group 'geiser) -(defcustom geiser-guile-binary +(geiser-custom--defcustom geiser-guile-binary (cond ((eq system-type 'windows-nt) "guile.exe") ((eq system-type 'darwin) "guile") (t "guile")) @@ -33,18 +33,18 @@ :type '(choice string (repeat string)) :group 'geiser-guile) -(defcustom geiser-guile-load-path nil +(geiser-custom--defcustom geiser-guile-load-path nil "A list of paths to be added to Guile's load path when it's started." :type '(repeat file) :group 'geiser-guile) -(defcustom geiser-guile-init-file "~/.guile-geiser" +(geiser-custom--defcustom geiser-guile-init-file "~/.guile-geiser" "Initialization file with user code for the Guile REPL." :type 'string :group 'geiser-guile) -(defcustom geiser-guile-use-compiler-in-eval t +(geiser-custom--defcustom geiser-guile-use-compiler-in-eval t "When enable, always use Guile's compiler to perform evaluation. Recommended, since the compiler usually collects better metadata than the interpreter." diff --git a/elisp/geiser-impl.el b/elisp/geiser-impl.el index 1725907..e0e4a39 100644 --- a/elisp/geiser-impl.el +++ b/elisp/geiser-impl.el @@ -12,6 +12,7 @@ (require 'geiser-eval) +(require 'geiser-custom) (require 'geiser-base) (require 'geiser-completion) @@ -22,17 +23,17 @@ "Generic support for multiple Scheme implementations." :group 'geiser) -(defcustom geiser-impl-default-implementation nil +(geiser-custom--defcustom geiser-impl-default-implementation nil "Symbol naming the default Scheme implementation." :type 'symbol :group 'geiser-impl) -(defcustom geiser-impl-installed-implementations nil +(geiser-custom--defcustom geiser-impl-installed-implementations nil "Initial list of installed Scheme implementations." :type '(repeat symbol) :group 'geiser-impl) -(defcustom geiser-impl-implementations-alist nil +(geiser-custom--defcustom geiser-impl-implementations-alist nil "A map from regular expressions or directories to implementations. When opening a new file, its full path will be matched against each one of the regular expressions or directories in this map in order to diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index a1e2e30..571e750 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -33,18 +33,18 @@ "Mode enabling Geiser abilities in Scheme buffers &co.." :group 'geiser) -(defcustom geiser-mode-autodoc-p t +(geiser-custom--defcustom geiser-mode-autodoc-p t "Whether `geiser-autodoc-mode' gets enabled by default in Scheme buffers." :group 'geiser-mode :group 'geiser-autodoc :type 'boolean) -(defcustom geiser-mode-company-p t +(geiser-custom--defcustom geiser-mode-company-p t "Whether to use company-mode for completion, if available." :group 'geiser-mode :type 'boolean) -(defcustom geiser-mode-smart-tab-p nil +(geiser-custom--defcustom geiser-mode-smart-tab-p nil "Whether `geiser-smart-tab-mode' gets enabled by default in Scheme buffers." :group 'geiser-mode :type 'boolean) diff --git a/elisp/geiser-plt.el b/elisp/geiser-plt.el index ab194b7..86073e5 100644 --- a/elisp/geiser-plt.el +++ b/elisp/geiser-plt.el @@ -25,7 +25,7 @@ "Customization for Geiser's PLT flavour." :group 'geiser) -(defcustom geiser-plt-binary +(geiser-custom--defcustom geiser-plt-binary (cond ((eq system-type 'windows-nt) "MzScheme.exe") ((eq system-type 'darwin) "mzscheme") (t "mzscheme")) @@ -33,12 +33,12 @@ :type '(choice string (repeat string)) :group 'geiser-plt) -(defcustom geiser-plt-collects nil +(geiser-custom--defcustom geiser-plt-collects nil "A list of paths to be added to mzscheme's collection directories." :type '(repeat file) :group 'geiser-plt) -(defcustom geiser-plt-init-file "~/.plt-geiser" +(geiser-custom--defcustom geiser-plt-init-file "~/.plt-geiser" "Initialization file with user code for the mzscheme REPL." :type 'string :group 'geiser-plt) diff --git a/elisp/geiser-reload.el b/elisp/geiser-reload.el index 80d6a17..d3b62eb 100644 --- a/elisp/geiser-reload.el +++ b/elisp/geiser-reload.el @@ -14,6 +14,7 @@ (require 'geiser-impl) (require 'geiser-repl) (require 'geiser-mode) +(require 'geiser-custom) (require 'geiser-base) (require 'geiser) @@ -66,14 +67,14 @@ loaded again." (file-exists-p (expand-file-name "geiser-reload.elc" dir))) (error "%s does not contain Geiser!" dir)) (let ((installed (featurep 'geiser-install)) - (installed-impls geiser-impl-installed-implementations) + (memo (geiser-custom--memoized-state)) (impls geiser-impl--impls) (repls (geiser-repl--repl-list)) (buffers (geiser-mode--buffers))) (geiser-unload) (setq load-path (remove old-dir load-path)) (add-to-list 'load-path dir) - (setq geiser-impl-installed-implementations installed-impls) + (mapc (lambda (x) (set (car x) (cdr x))) memo) (require 'geiser-reload) (when installed (require 'geiser-install nil t)) (geiser-impl--reload-implementations impls) diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index fe2f6a4..e8e4975 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -27,41 +27,41 @@ "Interacting with the Geiser REPL." :group 'geiser) -(defcustom geiser-repl-use-other-window t +(geiser-custom--defcustom geiser-repl-use-other-window t "Whether to Use a window other than the current buffer's when switching to the Geiser REPL buffer." :type 'boolean :group 'geiser-repl) -(defcustom geiser-repl-window-allow-split t +(geiser-custom--defcustom geiser-repl-window-allow-split t "Whether to allow window splitting when switching to the Geiser REPL buffer." :type 'boolean :group 'geiser-repl) -(defcustom geiser-repl-history-filename (expand-file-name "~/.geiser_history") +(geiser-custom--defcustom geiser-repl-history-filename (expand-file-name "~/.geiser_history") "File where REPL input history is saved, so that it persists between sessions. This is actually the base name: the concrete Scheme implementation name gets appended to it." :type 'filename :group 'geiser-repl) -(defcustom geiser-repl-history-size comint-input-ring-size +(geiser-custom--defcustom geiser-repl-history-size comint-input-ring-size "Maximum size of the saved REPL input history." :type 'integer :group 'geiser-repl) -(defcustom geiser-repl-autodoc-p t +(geiser-custom--defcustom geiser-repl-autodoc-p t "Whether to enable `geiser-autodoc-mode' in the REPL by default." :type 'boolean :group 'geiser-repl) -(defcustom geiser-repl-company-p t +(geiser-custom--defcustom geiser-repl-company-p t "Whether to use company-mode for completion, if available." :group 'geiser-mode :type 'boolean) -(defcustom geiser-repl-read-only-prompt-p t +(geiser-custom--defcustom geiser-repl-read-only-prompt-p t "Whether the REPL's prompt should be read-only." :type 'boolean :group 'geiser-repl) |