summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-03-13 02:02:40 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-03-13 02:02:40 +0100
commit137d2e0db5efe444f6f208aba8ebd57584f1ee52 (patch)
treeaebb89305d9adf5305bef9a9668c653c71d45372
parent7196cb2405c2773f394954904b63765fb9f95e8b (diff)
downloadgeiser-chez-137d2e0db5efe444f6f208aba8ebd57584f1ee52.tar.gz
geiser-chez-137d2e0db5efe444f6f208aba8ebd57584f1ee52.tar.bz2
Module documentation command works again when invoked from the REPL.
-rw-r--r--elisp/geiser-doc.el11
-rw-r--r--elisp/geiser-impl.el20
-rw-r--r--elisp/geiser-repl.el8
3 files changed, 25 insertions, 14 deletions
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el
index 1bf9725..34ed832 100644
--- a/elisp/geiser-doc.el
+++ b/elisp/geiser-doc.el
@@ -189,13 +189,14 @@ With prefix argument, ask for symbol (with completion)."
(when symbol (geiser-doc-symbol symbol))))
-(defun geiser-doc-module (module &optional impl)
+(defun geiser-doc-module (&optional module impl)
"Display information about a given module."
- (interactive (list (geiser-completion--read-module)))
- (let ((children (geiser-doc--get-module-children module))
- (impl (or impl geiser-impl--implementation)))
+ (interactive)
+ (let* ((module (geiser-completion--read-module))
+ (children (geiser-doc--get-module-children module))
+ (impl (or impl geiser-impl--implementation)))
(if (not children)
- (message "No info available for %s" module)
+ (message "No information available for %s" module)
(geiser-doc--with-buffer
(erase-buffer)
(geiser-doc--insert-title (format "%s" module))
diff --git a/elisp/geiser-impl.el b/elisp/geiser-impl.el
index b50f7be..4f70b29 100644
--- a/elisp/geiser-impl.el
+++ b/elisp/geiser-impl.el
@@ -100,21 +100,25 @@
(when (geiser-impl--fboundp imp name)
(apply (geiser-impl--value imp name t) args)))
-(defun geiser-impl--install-eval (imp)
- (setq geiser-eval--get-module-function
- (geiser-impl--sym imp "get-module")
- geiser-eval--geiser-procedure-function
- (geiser-impl--sym imp "geiser-procedure")))
+(defsubst geiser-impl--module-function (impl)
+ (geiser-impl--sym impl "get-module"))
+
+(defsubst geiser-impl--geiser-procedure-function (impl)
+ (geiser-impl--sym imp "geiser-procedure"))
+
+(defun geiser-impl--install-eval (impl)
+ (setq geiser-eval--get-module-function (geiser-impl--module-function impl))
+ (setq geiser-eval--geiser-procedure-function
+ (geiser-impl--geiser-procedure-function impl)))
;;; Evaluating Elisp in a given implementation context:
(defun with--geiser-implementation (imp thunk)
(let ((geiser-impl--implementation imp)
- (geiser-eval--get-module-function
- (geiser-impl--sym imp "get-module"))
+ (geiser-eval--get-module-function (geiser-impl--module-function imp))
(geiser-eval--geiser-procedure-function
- (geiser-impl--sym imp "geiser-procedure")))
+ (geiser-impl--geiser-procedure-function imp)))
(funcall thunk)))
(put 'with--geiser-implementation 'lisp-indent-function 1)
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 10a91a4..c362787 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -248,6 +248,12 @@ If no REPL is running, execute `run-geiser' to start a fresh one."
(defun geiser-repl--module-function (&optional ignore) :f)
+(defun geiser-repl--doc-module ()
+ (interactive)
+ (let ((geiser-eval--get-module-function
+ (geiser-impl--module-function geiser-impl--implementation)))
+ (geiser-doc-module)))
+
(define-derived-mode geiser-repl-mode comint-mode "Geiser REPL"
"Major mode for interacting with an inferior scheme repl process.
\\{geiser-repl-mode-map}"
@@ -265,7 +271,7 @@ If no REPL is running, execute `run-geiser' to start a fresh one."
(define-key geiser-repl-mode-map "\C-a" 'geiser-repl--bol)
(define-key geiser-repl-mode-map "\C-ca" 'geiser-autodoc-mode)
(define-key geiser-repl-mode-map "\C-cd" 'geiser-doc-symbol-at-point)
-(define-key geiser-repl-mode-map "\C-cm" 'geiser-doc-module)
+(define-key geiser-repl-mode-map "\C-cm" 'geiser-repl--doc-module)
(define-key geiser-repl-mode-map "\C-ck" 'geiser-compile-file)
(define-key geiser-repl-mode-map "\C-cl" 'geiser-load-file)