diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2016-06-12 17:51:28 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2016-06-12 17:51:28 +0200 |
commit | bb990e11cd91956d10d156982d29cec50fee75bf (patch) | |
tree | 1326ec1d6a6f3f06a15e381237b628cd91166a96 | |
parent | 48c0cb1f5ceeb12824c9465d0549583e970ab983 (diff) | |
download | geiser-bb990e11cd91956d10d156982d29cec50fee75bf.tar.gz geiser-bb990e11cd91956d10d156982d29cec50fee75bf.tar.bz2 |
REPLs not started by the font-lock buffer
This one should fix github's issue #132. There's still the glitch that
scheme strings are fontified without taking into account extra keywords.
-rw-r--r-- | elisp/geiser-mode.el | 1 | ||||
-rw-r--r-- | elisp/geiser-syntax.el | 22 |
2 files changed, 14 insertions, 9 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index 640dbcc..5747f40 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -303,6 +303,7 @@ interacting with the Geiser REPL is at your disposal. (geiser-syntax--add-kws) (when (and geiser-mode geiser-mode-start-repl-p + (not (geiser-syntax--font-lock-buffer-p)) (not (geiser-repl--connection*))) (save-window-excursion (run-geiser geiser-impl--implementation)))) diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el index 79f899b..0abd03c 100644 --- a/elisp/geiser-syntax.el +++ b/elisp/geiser-syntax.el @@ -472,16 +472,20 @@ implementation-specific entries for font-lock-keywords.") (geiser-syntax--mapconcat 'geiser-syntax--display a " "))) (t (format "%s" a)))) +(defconst geiser-syntax--font-lock-buffer-name " *geiser font lock*") + +(defun geiser-syntax--font-lock-buffer-p (&optional buffer) + (equal (buffer-name buffer) geiser-syntax--font-lock-buffer-name)) + (defun geiser-syntax--font-lock-buffer () - (let ((name " *geiser font lock*")) - (or (get-buffer name) - (let ((buffer (get-buffer-create name))) - (set-buffer buffer) - (let ((geiser-default-implementation - (or geiser-default-implementation - (car geiser-active-implementations)))) - (scheme-mode)) - buffer)))) + (or (get-buffer geiser-syntax--font-lock-buffer-name) + (let ((buffer (get-buffer-create geiser-syntax--font-lock-buffer))) + (set-buffer buffer) + (let ((geiser-default-implementation + (or geiser-default-implementation + (car geiser-active-implementations)))) + (scheme-mode))) + buffer)) (defun geiser-syntax--scheme-str (str) (save-current-buffer |