diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-04-11 07:16:17 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-04-11 07:16:17 +0200 |
commit | 2f48c7955f48b07d0aa656267b6b9954077626e0 (patch) | |
tree | 6a2ef834d21d671d10bd3067544084fe187199bb /elisp/geiser-mode.el | |
parent | 059025eeae73f2b91e2db157b3aa84c91f50f422 (diff) | |
download | geiser-2f48c7955f48b07d0aa656267b6b9954077626e0.tar.gz geiser-2f48c7955f48b07d0aa656267b6b9954077626e0.tar.bz2 |
New flag to automatically start REPLs when geiser-mode is activated
When no live REPL is found, of course. The flag's imaginatively
called geiser-mode-start-repl-p.
Diffstat (limited to 'elisp/geiser-mode.el')
-rw-r--r-- | elisp/geiser-mode.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index 77feeec..b6d083a 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -41,6 +41,12 @@ scheme buffers." :group 'geiser-mode :type 'boolean) +(geiser-custom--defcustom geiser-mode-start-repl-p nil + "Whether a REPL should be automatically started if one is not +active when `geiser-mode' is activated in a buffer." + :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 @@ -258,7 +264,11 @@ interacting with the Geiser REPL is at your disposal. (geiser-autodoc-mode (if geiser-mode 1 -1))) (when geiser-mode-smart-tab-p (geiser-smart-tab-mode (if geiser-mode 1 -1))) - (geiser-syntax--add-kws)) + (geiser-syntax--add-kws) + (when (and geiser-mode + geiser-mode-start-repl-p + (not (geiser-repl--connection*))) + (save-current-buffer (switch-to-geiser)))) (defun turn-on-geiser-mode () "Enable `geiser-mode' (in a Scheme buffer)." |