summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-13 02:31:39 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-13 02:31:39 +0100
commit7194141f5e53cd0b360d3ee53c3337823da6ae9f (patch)
tree479f25bfe6e8884703d857a9d4bf7ea942473e0d /elisp
parent33d9ce47c90674acfe8b60afdb4dfc9657c4e2be (diff)
downloadgeiser-7194141f5e53cd0b360d3ee53c3337823da6ae9f.tar.gz
geiser-7194141f5e53cd0b360d3ee53c3337823da6ae9f.tar.bz2
geiser-mode-auto-p: automatic geiser-mode is now optional
It hadn't occurred to me that anyone wouldn't want non-automatic geiser-mode often enough to require its own customization variable. Rotty proved me wrong. Or maybe not, but he deserves a custom var!
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-mode.el9
-rw-r--r--elisp/geiser.el4
2 files changed, 12 insertions, 1 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el
index 719176d..8f8b7fe 100644
--- a/elisp/geiser-mode.el
+++ b/elisp/geiser-mode.el
@@ -34,6 +34,12 @@
"Mode enabling Geiser abilities in Scheme buffers &co.."
:group 'geiser)
+(geiser-custom--defcustom geiser-mode-auto-p t
+ "Whether `geiser-mode' should be active by default in all
+scheme buffers."
+ :group 'geiser-mode
+ :type 'boolean)
+
(geiser-custom--defcustom geiser-mode-autodoc-p t
"Whether `geiser-autodoc-mode' gets enabled by default in Scheme buffers."
:group 'geiser-mode
@@ -250,6 +256,9 @@ interacting with the Geiser REPL is at your disposal.
(interactive)
(geiser-mode -1))
+(defun geiser-mode--maybe-activate ()
+ (when geiser-mode-auto-p (turn-on-geiser-mode)))
+
;;; Keys:
diff --git a/elisp/geiser.el b/elisp/geiser.el
index d40b6a8..d293423 100644
--- a/elisp/geiser.el
+++ b/elisp/geiser.el
@@ -67,6 +67,8 @@
(autoload 'turn-off-geiser-mode "geiser-mode"
"Disable Geiser's mode (useful in Scheme buffers)." t)
+(autoload 'geiser-mode--maybe-activate "geiser-mode")
+
(mapc (lambda (group)
(custom-add-load group (symbol-name group))
(custom-add-load 'geiser (symbol-name group)))
@@ -85,7 +87,7 @@
;;; Setup:
(eval-after-load "scheme"
- '(add-hook 'scheme-mode-hook 'turn-on-geiser-mode))
+ '(add-hook 'scheme-mode-hook 'geiser-mode--maybe-activate))
(add-to-list 'auto-mode-alist '("\\.rkt\\'" . scheme-mode))