diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-06 00:55:41 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-06 00:55:41 +0100 |
commit | 1f8abf10f7167cacf122a2eaa50acc66f0974d53 (patch) | |
tree | b63266a8cd8efb27ac07cec9936c432793666979 | |
parent | 754aa7a194c412f52b4733142566ed5e33a04f4f (diff) | |
download | geiser-chez-1f8abf10f7167cacf122a2eaa50acc66f0974d53.tar.gz geiser-chez-1f8abf10f7167cacf122a2eaa50acc66f0974d53.tar.bz2 |
A bit more robust generic methods.
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | elisp/geiser-mode.el | 2 | ||||
-rw-r--r-- | elisp/geiser-xref.el | 11 | ||||
-rw-r--r-- | scheme/guile/geiser/xref.scm | 6 |
4 files changed, 10 insertions, 11 deletions
@@ -42,7 +42,7 @@ |------------------+-------------------------------------------------| | C-cC-dd | See documentation for symbol at point | | C-cC-dm | See module symbols documentation | - | C-cC-dg | See generic methods | + | C-cC-dp | See generic methods | | C-cC-da | Toggle autodoc mode | |------------------+-------------------------------------------------| | M-TAB | Complete symbol at point | diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index 3520925..a96dbaa 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -194,7 +194,7 @@ interacting with the Geiser REPL is at your disposal. (geiser-mode--triple-chord ?d ?a 'geiser-autodoc-mode) (geiser-mode--triple-chord ?d ?d 'geiser-doc-symbol-at-point) -(geiser-mode--triple-chord ?d ?g 'geiser-xref-generic-methods) +(geiser-mode--triple-chord ?d ?p 'geiser-xref-generic-methods) (geiser-mode--triple-chord ?d ?m 'geiser-doc-module) (geiser-mode--triple-chord ?e ?m 'geiser-edit-module) diff --git a/elisp/geiser-xref.el b/elisp/geiser-xref.el index 62375e0..f0920d8 100644 --- a/elisp/geiser-xref.el +++ b/elisp/geiser-xref.el @@ -63,18 +63,17 @@ (geiser-edit--try-edit-location name location geiser-xref-follow-link-method)))) (defun geiser-xref--insert-button (xref) - (let ((location (cdr (assoc 'location xref))) - (signature (cdr (assoc 'signature xref)))) + (let* ((location (cdr (assoc 'location xref))) + (file (geiser-edit--location-file location)) + (signature (cdr (assoc 'signature xref)))) (when signature (insert "\t") - (if location + (if (stringp file) (insert-text-button (format "%s" signature) :type 'geiser-xref--button 'location location 'name (car signature) - 'help-echo (format "%s in %s" - (car signature) - (geiser-edit--location-file location))) + 'help-echo (format "%s in %s" (car signature) file)) (insert (format "%s" signature))) (newline)))) diff --git a/scheme/guile/geiser/xref.scm b/scheme/guile/geiser/xref.scm index c94835a..cb39c5d 100644 --- a/scheme/guile/geiser/xref.scm +++ b/scheme/guile/geiser/xref.scm @@ -46,17 +46,17 @@ (define (describe-method name m) (let ((proc (method-procedure m))) (if proc - `((location . ,(program-location proc)) + `((location . ,(or (program-location proc) (symbol-location name))) (signature . ,(object-signature name proc))) '()))) (define (program-location p) - (cond ((not (program? p)) '()) + (cond ((not (program? p)) #f) ((program-source p 0) => (lambda (s) (make-location (program-path p) (source:line s)))) ((program-path p) => (lambda (s) (make-location (program-path p) #f))) - (else '()))) + (else #f))) (define (program-path p) (let* ((mod (program-module p)) |