[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile fe48642 008/284: M-. working for any symbol w
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile fe48642 008/284: M-. working for any symbol whose module can be located. |
Date: |
Sun, 1 Aug 2021 18:29:06 -0400 (EDT) |
branch: elpa/geiser-guile
commit fe4864246c62fbdab1eb5606ba27aaeb3a9ab7cc
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
M-. working for any symbol whose module can be located.
---
geiser/introspection.scm | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/geiser/introspection.scm b/geiser/introspection.scm
index 03d5796..136ada3 100644
--- a/geiser/introspection.scm
+++ b/geiser/introspection.scm
@@ -89,16 +89,7 @@
(let ((src (program-source prog 0)))
(and src (source:line src))))
-(define (module-filename name)
- (let* ((name (map symbol->string name))
- (reverse-name (reverse name))
- (leaf (car reverse-name))
- (dir-hint-module-name (reverse (cdr reverse-name)))
- (dir-hint (apply string-append
- (map (lambda (elt)
- (string-append elt "/"))
- dir-hint-module-name))))
- (%search-load-path (in-vicinity dir-hint leaf))))
+(define module-filename (@@ (ice-9 session) module-filename))
(define (program-file prog)
(let* ((mod (and prog (program-module prog)))
@@ -108,10 +99,22 @@
(define (program-location prog)
(make-location (program-file prog) (program-line prog)))
+(define (symbol-module sym)
+ (call/cc
+ (lambda (k)
+ (apropos-fold (lambda (module name var init)
+ (if (eq? name sym) (k (module-name module)) init))
+ #f
+ (symbol->string sym)
+ (apropos-fold-accessible (current-module))))))
+
+(define (make-location-from-module-name name)
+ (make-location (module-filename name) #f))
+
(define (symbol-location sym)
(let ((prog (resolve-symbol sym)))
- (if (program? prog)
- (program-location prog)
- '())))
+ (cond ((program? prog) (program-location prog))
+ ((symbol-module sym) => make-location-from-module-name)
+ (else '()))))
;;; introspection.scm ends here
- [nongnu] elpa/geiser-guile 56671f6 015/284: New command to get docstrings (C-cC-d)., (continued)
- [nongnu] elpa/geiser-guile 56671f6 015/284: New command to get docstrings (C-cC-d)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f857023 007/284: Edit symbol at point for programs., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d0f98a7 036/284: Simpler handling of rest args in Emacs' side., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 221e64e 042/284: Some refactoring and new ge:macroexpand., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d69ca12 044/284: Autodoc support for GOOPS methods., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 4d48077 046/284: Fix recursive require. Nicer arg names in autodoc., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 5be0195 049/284: Cache arguments parsed from documentation; don't treat quasiquote as a function., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6ff9936 052/284: They say call/cc is slow in Guile., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile a96b437 053/284: turn-on/off-geiser-mode commands added and used in scheme-mode-hook., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d71825c 058/284: Small bug fix., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile fe48642 008/284: M-. working for any symbol whose module can be located.,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile 75df3b1 024/284: Better symbol documentation., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 8cb76f1 045/284: Breakdown of schemeland into neat submodules., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7b77380 054/284: New command to display generic methods (C-cC-dg) implemented., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 33b8c53 066/284: Callers/callees (C-c <, C-c >)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3398bc2 012/284: Inconsequential refactorings., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile af1c5a3 013/284: Small improvements., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile a461795 017/284: Better docstring., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6f2ed87 018/284: Recognise empty doc string in Emacs side. Small refactorings., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 63c39be 019/284: Initial support for module name completion., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 06fabb2 020/284: Compile command adapted to new compiled-file-name behaviour., Philip Kaludercic, 2021/08/01