summaryrefslogtreecommitdiff
path: root/scheme/guile/geiser/xref.scm
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-04-05 06:40:05 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-04-05 06:40:05 +0200
commit8e72e66019fdab0fe2ea8f57faec57c06f7bf108 (patch)
tree6ac2ca56fc93ec3f81226afd5aca02477d0559da /scheme/guile/geiser/xref.scm
parent0dcfbf2be66437b4a453a09b6485e8bc65218558 (diff)
downloadgeiser-guile-8e72e66019fdab0fe2ea8f57faec57c06f7bf108.tar.gz
geiser-guile-8e72e66019fdab0fe2ea8f57faec57c06f7bf108.tar.bz2
Using the new (system xref) interface.
Diffstat (limited to 'scheme/guile/geiser/xref.scm')
-rw-r--r--scheme/guile/geiser/xref.scm19
1 files changed, 14 insertions, 5 deletions
diff --git a/scheme/guile/geiser/xref.scm b/scheme/guile/geiser/xref.scm
index 059fbb0..f00f724 100644
--- a/scheme/guile/geiser/xref.scm
+++ b/scheme/guile/geiser/xref.scm
@@ -42,7 +42,9 @@
(define (generic-methods sym)
(let* ((gen (symbol->object sym))
- (methods (if (is-a? gen <generic>) (generic-function-methods gen) '())))
+ (methods (if (is-a? gen <generic>)
+ (generic-function-methods gen)
+ '())))
(filter (lambda (x) (not (null? x)))
(map (lambda (m)
(make-xref (method-procedure m) sym (symbol-module sym)))
@@ -67,14 +69,21 @@
(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 (procedure-xref proc . mod-name)
+ (let ((proc-name (or (procedure-name proc) '<anonymous>))
+ (mod-name (if (null? mod-name)
+ (symbol-module name)
+ (car mod-name))))
+ (make-xref proc proc-name mod-name)))
(define (callers sym)
(let ((mod (symbol-module sym #t)))
(and mod
- (map procedure-xref (procedure-callers (cons mod sym))))))
+ (apply append (map (lambda (procs)
+ (map (lambda (proc)
+ (procedure-xref proc (car procs)))
+ (cdr procs)))
+ (procedure-callers (cons mod sym)))))))
(define (callees sym)
(let ((obj (symbol->object sym)))