branch: elpa/geiser-gauche
commit 0cbfe13ea1bf657d4d6a096a3f22c6b7d0f87bd1
Author: Visuwesh <[email protected]>
Commit: Andras Simonyi <[email protected]>
Avoid sending the shebang line to REPL when doing C-c C-b
* geiser-gauche.el (geiser-gauche--eval-bounds): Prevent the inclusion
of the shebang line.
(gauche): Pass the above eval-bounds function.
---
geiser-gauche.el | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/geiser-gauche.el b/geiser-gauche.el
index d8f91f8221c..3197abac868 100644
--- a/geiser-gauche.el
+++ b/geiser-gauche.el
@@ -250,6 +250,16 @@
(let ((form (mapconcat #'identity args " ")))
(format "(eval '(geiser:%s %s) (find-module 'geiser))" proc form)))))
+(defun geiser-gauche--eval-bounds ()
+ "Return the bounds for `geiser-eval-buffer' command."
+ (cons (if (equal "#!" (buffer-substring (point-min) (+ 2 (point-min))))
+ (save-excursion
+ (goto-char (point-min))
+ (forward-line 1)
+ (point))
+ (point-min))
+ (point-max)))
+
;;; Module handling
@@ -362,7 +372,8 @@ form."
(external-help geiser-gauche--manual-look-up)
(check-buffer geiser-gauche--guess)
(keywords geiser-gauche--keywords)
- (case-sensitive geiser-gauche-case-sensitive-p))
+ (case-sensitive geiser-gauche-case-sensitive-p)
+ (eval-bounds geiser-gauche--eval-bounds))
(geiser-implementation-extension 'gauche "scm")