diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2014-01-10 06:20:05 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2014-01-10 06:20:05 +0100 |
commit | f9b2ed86077a79718b083e49f752cf01457e1459 (patch) | |
tree | abcfbe4910f1462185f385cb78d6ce6b5b4b473e /elisp/geiser-racket.el | |
parent | 826a054761d0f12f243883a001b2392279580a7f (diff) | |
download | geiser-guile-f9b2ed86077a79718b083e49f752cf01457e1459.tar.gz geiser-guile-f9b2ed86077a79718b083e49f752cf01457e1459.tar.bz2 |
Racket: better behaviour of geiser-eval-buffer
For buffers containing a #lang directive, geiser-eval-buffer was simply
broken: one cannot send the whole region wrapped in a `begin' in that
case.
We try now to send the region below, although a real solution would
imply using #%module-begin as the wrapper, in order to be robust for
languages that define their own version of the macro (such as TR).
But people should use C-c C-a or C-c C-k and leave this silly function
alone instead.
Diffstat (limited to 'elisp/geiser-racket.el')
-rw-r--r-- | elisp/geiser-racket.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el index 59886e3..e466ce3 100644 --- a/elisp/geiser-racket.el +++ b/elisp/geiser-racket.el @@ -1,6 +1,6 @@ ;; geiser-racket.el -- geiser support for Racket scheme -;; Copyright (C) 2009, 2010, 2011, 2012, 2013 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 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 @@ -137,11 +137,14 @@ using start-geiser, a procedure in the geiser/server module." (geiser-syntax--form-from-string (match-string-no-properties 1)))) "#f")) -(defun geiser-racket--implicit-module () +(defun geiser-racket--implicit-module (&optional pos) (save-excursion (goto-char (point-min)) (when (re-search-forward "^#lang " nil t) - (buffer-file-name)))) + (if pos (progn (end-of-line) (list (point))) (buffer-file-name))))) + +(defun geiser-racket--eval-bounds () + (geiser-racket--implicit-module t)) (defun geiser-racket--find-module () (let ((bf (geiser-racket--implicit-module)) @@ -428,6 +431,7 @@ Use a prefix to be asked for a submodule name." (import-command geiser-racket--import-command) (exit-command geiser-racket--exit-command) (find-symbol-begin geiser-racket--symbol-begin) + (eval-bounds geiser-racket--eval-bounds) (display-error geiser-racket--display-error) (external-help geiser-racket--external-help) (check-buffer geiser-racket--guess) |