[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile 33b8c53 066/284: Callers/callees (C-c <, C-c
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile 33b8c53 066/284: Callers/callees (C-c <, C-c >). |
Date: |
Sun, 1 Aug 2021 18:29:17 -0400 (EDT) |
branch: elpa/geiser-guile
commit 33b8c5311efda6d0b1aaaad0465f59415f5540c4
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Callers/callees (C-c <, C-c >).
---
geiser/emacs.scm | 4 +++-
geiser/xref.scm | 34 ++++++++++++++++++++++++++--------
2 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/geiser/emacs.scm b/geiser/emacs.scm
index 0c99216..13bd8db 100644
--- a/geiser/emacs.scm
+++ b/geiser/emacs.scm
@@ -37,7 +37,9 @@
ge:symbol-documentation
ge:all-modules
ge:module-children
- ge:module-location)
+ ge:module-location
+ ge:callers
+ ge:callees)
#:use-module (geiser evaluation)
#:use-module ((geiser modules) :renamer (symbol-prefix-proc 'ge:))
#:use-module ((geiser completion) :renamer (symbol-prefix-proc 'ge:))
diff --git a/geiser/xref.scm b/geiser/xref.scm
index cb39c5d..ec86d7c 100644
--- a/geiser/xref.scm
+++ b/geiser/xref.scm
@@ -26,11 +26,14 @@
(define-module (geiser xref)
#:export (symbol-location
- generic-methods)
+ generic-methods
+ callers
+ callees)
#:use-module (geiser utils)
#:use-module (geiser modules)
#:use-module (geiser doc)
#:use-module (oop goops)
+ #:use-module (system xref)
#:use-module (system vm program))
(define (symbol-location sym)
@@ -41,14 +44,15 @@
(let* ((gen (symbol->object sym))
(methods (if (is-a? gen <generic>) (generic-function-methods gen)
'())))
(filter (lambda (x) (not (null? x)))
- (map (lambda (m) (describe-method sym m)) methods))))
+ (map (lambda (m)
+ (make-xref (method-procedure m) sym (symbol-module sym)))
+ methods))))
-(define (describe-method name m)
- (let ((proc (method-procedure m)))
- (if proc
- `((location . ,(or (program-location proc) (symbol-location name)))
- (signature . ,(object-signature name proc)))
- '())))
+(define (make-xref proc name module)
+ (and proc
+ `((location . ,(or (program-location proc) (symbol-location name)))
+ (signature . ,(object-signature name proc))
+ (module . ,module))))
(define (program-location p)
(cond ((not (program? p)) #f)
@@ -63,4 +67,18 @@
(name (and mod (module-name mod))))
(and name (module-filename name))))
+(define (procedure-xref proc)
+ (let ((name (procedure-name proc)))
+ (make-xref proc name (symbol-module name))))
+
+(define (callers sym)
+ (let ((mod (symbol-module sym)))
+ (and mod
+ (map procedure-xref (procedure-callers (cons mod sym))))))
+
+(define (callees sym)
+ (let ((obj (symbol->object sym)))
+ (and obj
+ (map procedure-xref (procedure-callees obj)))))
+
;;; xref.scm ends here
- [nongnu] elpa/geiser-guile d69ca12 044/284: Autodoc support for GOOPS methods., (continued)
- [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, 2021/08/01
- [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 <=
- [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
- [nongnu] elpa/geiser-guile 3432ccf 021/284: New command: module documentation., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 08ba036 023/284: Separate commands for evaluation and compilation., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d18c35b 025/284: Fix in symbol help signature displaying., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3655a74 026/284: (geiser eval) functionality moved to (geiser emacs)., Philip Kaludercic, 2021/08/01