[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-gauche f5ddefb 043/119: Prefer current-module visib
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-gauche f5ddefb 043/119: Prefer current-module visible alternatives in autodoc |
Date: |
Sun, 1 Aug 2021 18:27:54 -0400 (EDT) |
branch: elpa/geiser-gauche
commit f5ddefb802201ace3329545d818f52d7b19f40ef
Author: András Simonyi <andras.simonyi@gmail.com>
Commit: András Simonyi <andras.simonyi@gmail.com>
Prefer current-module visible alternatives in autodoc
---
geiser-gauche.el | 8 ++++++--
geiser.scm | 18 +++++++++++-------
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/geiser-gauche.el b/geiser-gauche.el
index 572b25c..055a2bc 100644
--- a/geiser-gauche.el
+++ b/geiser-gauche.el
@@ -95,11 +95,15 @@
(t
"#f")))
(form (mapconcat 'identity (cdr args) " ")))
- (format "(eval '(geiser:eval %s '%s) (find-module 'geiser))" module
form)))
+ ;; {{cur-module}} is replaced by the current module for the commands
+ (replace-regexp-in-string
+ "{{cur-module}}" module
+ (format "(eval '(geiser:eval %s '%s) (find-module 'geiser))" module
form))))
;; The rest of the commands are all evaluated in the geiser module
(t
(let ((form (mapconcat 'identity args " ")))
- (format "(eval '(geiser:%s %s) (find-module 'geiser))" proc form)))))
+ ;; {{cur-module}} will be replaced by the current module when eval is
called
+ (format "(eval '(geiser:%s %s {{cur-module}}) (find-module 'geiser))"
proc form)))))
(defconst geiser-gauche--module-re
"(define-module +\\([[:alnum:].]+\\)")
diff --git a/geiser.scm b/geiser.scm
index 28fc78e..64742df 100644
--- a/geiser.scm
+++ b/geiser.scm
@@ -57,8 +57,8 @@
(cut pprint (macroexpand form))))
(define (geiser:eval module-name form . rest)
- (call-with-output-file "/tmp/gauche.log"
- (^o (format o "FORM: ~s, REST: ~s" form rest)))
+ ;; (call-with-output-file "/tmp/gauche.log"
+ ;; (^o (format o "FORM: ~s, REST: ~s" form rest)))
(let* ((output (open-output-string))
(module (or (and (symbol? module-name )
(find-module module-name))
@@ -136,11 +136,11 @@
;;; Autodoc
(define (geiser:autodoc symbols . rest)
- (map (cut formatted-autodoc <>)
+ (map (cut formatted-autodoc <> (car rest))
symbols))
-(define (formatted-autodoc symbol)
- (format-autodoc-signature (autodoc-signature symbol)))
+(define (formatted-autodoc symbol cur-module)
+ (format-autodoc-signature (autodoc-signature symbol cur-module)))
(define (format-autodoc-signature as)
(if (symbol? as)
@@ -155,10 +155,14 @@
;; Return a (signature module) pair to be displayed in autodoc for SYMBOL.
;; Return a (SYMBOL module) pair if SYMBOL is bound without signature and
;; SYMBOL if no binding was found.
-(define (autodoc-signature symbol)
+(define (autodoc-signature symbol cur-module)
(let1 sigs (signatures symbol)
(if (not (null? sigs))
- (or (find (^x ($ not $ symbol? $ car x)) sigs)
+ ;; Prefer the binding which visible from the current module
+ (or (find (^x (eq? (global-variable-ref cur-module symbol #f)
+ (global-variable-ref (cdr x) symbol #f)))
+ sigs)
+ (find (^x ($ not $ symbol? $ car x)) sigs)
(car sigs))
symbol)))
- [nongnu] elpa/geiser-gauche a1ef874 049/119: Finish module info for now, (continued)
- [nongnu] elpa/geiser-gauche a1ef874 049/119: Finish module info for now, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 4027a84 053/119: Minor fix, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 2e6dbc4 076/119: Aesthetic changes, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 6806302 077/119: Cosmetic changes for MELPA, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 0be6e0a 081/119: Add setup elisp file, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche a3b2e3f 009/119: Remove test line, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 0050571 021/119: Minor fix in autodoc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 7635884 020/119: Minor fix, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche c96701c 047/119: Continue work on module docs, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 54a360a 029/119: Add symbol manual lookup support, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche f5ddefb 043/119: Prefer current-module visible alternatives in autodoc,
Philip Kaludercic <=
- [nongnu] elpa/geiser-gauche 4195803 028/119: Prefer longest require arg list in autodoc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche d5d68fd 039/119: Don't import the geiser module at startup, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 0fac12f 048/119: Improve module documentation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche a0eee47 068/119: Correctly detect current module in the repl, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 4890817 063/119: Add let1 and case-lambda to the syntax rules, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche d71c212 074/119: Add compile to the require list, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 34490de 078/119: Small corrections, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche aeeb8b3 080/119: Minor fix, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche dd68fc7 087/119: Update README.md, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 6dfc178 090/119: Add experimental status warning, Philip Kaludercic, 2021/08/01