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 | c71691ab5108aa84162ccae18a354527a6064dd4 (patch) | |
tree | 3d4b0e57fe2d64a44c5dcb6becf3bdc13b70df36 /elisp/geiser-mode.el | |
parent | 8ebeaeefbc7850dc19f651a7f5864c207de2ec52 (diff) | |
download | geiser-c71691ab5108aa84162ccae18a354527a6064dd4.tar.gz geiser-c71691ab5108aa84162ccae18a354527a6064dd4.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.
Diffstat (limited to 'elisp/geiser-mode.el')
-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: |