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 | 0085c16dc3add5722e86c738c0ff1fa969183d86 (patch) | |
tree | cc4ab3e5a1504ddfa2764659d813089fc3be7cad /elisp | |
parent | 3bb10cbc0c9a04afdf033efc4b293e5f49cbdfc9 (diff) | |
download | geiser-0085c16dc3add5722e86c738c0ff1fa969183d86.tar.gz geiser-0085c16dc3add5722e86c738c0ff1fa969183d86.tar.bz2 |
Correctly specify current module in REPL (and make it generic).
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-eval.el | 15 | ||||
-rw-r--r-- | elisp/geiser-repl.el | 1 |
2 files changed, 15 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))))) diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 3f1301c..9d01835 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -200,6 +200,7 @@ REPL buffer." (set (make-local-variable 'beginning-of-defun-function) 'geiser-repl--beginning-of-defun) (set-syntax-table scheme-mode-syntax-table) + (geiser-eval--current-module-function nil) (when geiser-repl-autodoc-p (geiser-autodoc-mode 1))) (define-key geiser-repl-mode-map "\C-cz" 'run-guile) |