diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2015-08-14 21:44:46 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2015-08-14 21:44:46 +0200 |
commit | 0f66c250245af1348a3ee5a698c69ec4245e2194 (patch) | |
tree | 086b3b0e253195f57c7ebf78ad236c6e579cc735 | |
parent | bfb4a8fce5828d15641164b475b830031c6d3335 (diff) | |
download | geiser-guile-0f66c250245af1348a3ee5a698c69ec4245e2194.tar.gz geiser-guile-0f66c250245af1348a3ee5a698c69ec4245e2194.tar.bz2 |
Don't try to turn on geiser-mode in non-scheme buffers
xscheme defines its own scheme-interaction-mode that, quite rudely if
you ask me, calls not only its hooks, but also scheme-mode's. Among
them, turn-on-geiser-mode, causing havoc to users of xscheme's
run-scheme function.
We, ahem, fix this problem by checking that we're actually in
scheme-mode when our hook is called.
Thanks to Federico Beffa for his reports.
-rw-r--r-- | elisp/geiser-mode.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index 3bc5494..f8329f8 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -1,6 +1,6 @@ ;; geiser-mode.el -- minor mode for scheme buffers -;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -36,8 +36,7 @@ :group 'geiser) (geiser-custom--defcustom geiser-mode-auto-p t - "Whether `geiser-mode' should be active by default in all -scheme buffers." + "Whether `geiser-mode' should be active by default in all scheme buffers." :group 'geiser-mode :type 'boolean) @@ -317,7 +316,8 @@ interacting with the Geiser REPL is at your disposal. (geiser-mode -1)) (defun geiser-mode--maybe-activate () - (when geiser-mode-auto-p (turn-on-geiser-mode))) + (when (and geiser-mode-auto-p (eq major-mode 'scheme-mode)) + (turn-on-geiser-mode))) ;;; Keys: |