From 0f66c250245af1348a3ee5a698c69ec4245e2194 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Fri, 14 Aug 2015 21:44:46 +0200 Subject: 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. --- elisp/geiser-mode.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'elisp') 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: -- cgit v1.2.3