summaryrefslogtreecommitdiff
path: root/elisp/geiser-custom.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-11 22:01:14 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-11 22:01:14 +0200
commit3265bb3b50c1199586205fab0febfdf0b91c3c2b (patch)
treee4049cfc17e514428a198b00f69a4dfc5db81c5b /elisp/geiser-custom.el
parentd6ebefe0eb609c813adeba9075200cbc4f0d8947 (diff)
downloadgeiser-3265bb3b50c1199586205fab0febfdf0b91c3c2b.tar.gz
geiser-3265bb3b50c1199586205fab0febfdf0b91c3c2b.tar.bz2
Reload: we now remember user customizations and restore them during geiser-reload.
Diffstat (limited to 'elisp/geiser-custom.el')
-rw-r--r--elisp/geiser-custom.el17
1 files changed, 17 insertions, 0 deletions
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