diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-02 19:12:37 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-02 19:12:37 +0100 |
commit | 3124c25768b107233497acc009e378bd6a044339 (patch) | |
tree | cbd8324070925625c5fd4180fd5d03bdbac49d7d /elisp/geiser-eval.el | |
parent | 02208b6423a33ff28540c27cf3dca678e8a77b7a (diff) | |
download | geiser-guile-3124c25768b107233497acc009e378bd6a044339.tar.gz geiser-guile-3124c25768b107233497acc009e378bd6a044339.tar.bz2 |
Correctly specify current module in REPL (and make it generic).
Diffstat (limited to 'elisp/geiser-eval.el')
-rw-r--r-- | elisp/geiser-eval.el | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el index 09f12da..3e5e7aa 100644 --- a/elisp/geiser-eval.el +++ b/elisp/geiser-eval.el @@ -31,6 +31,19 @@ (require 'geiser-base) +;;; Plug-able functions: + +(make-variable-buffer-local + (defvar geiser-eval--current-module-function 'geiser-syntax--buffer-module)) + +(defsubst geiser-eval--current-module-function (fun) + (setq geiser-eval--current-module-function fun)) + +(defsubst geiser-eval--current-module () + (and geiser-eval--current-module-function + (funcall geiser-eval--current-module-function))) + + ;;; Code formatting: (defun geiser-eval--scheme-str (code) @@ -66,7 +79,7 @@ (defsubst geiser-eval--module (code) (geiser-eval--scheme-str (cond ((or (eq code '(())) (null code)) - `(quote ,(or (geiser-syntax--buffer-module) :f))) + `(quote ,(or (geiser-eval--current-module) :f))) ((listp code) `(quote ,code)) ((stringp code) (:scm code)) (t (error "Invalid module spec: %S" code))))) |