emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/geiser-gauche 060b7ee 062/119: Finish symbol location


From: Philip Kaludercic
Subject: [nongnu] elpa/geiser-gauche 060b7ee 062/119: Finish symbol location
Date: Sun, 1 Aug 2021 18:27:58 -0400 (EDT)

branch: elpa/geiser-gauche
commit 060b7ee3e3239e6b89d4b1dadad384b69a1813f8
Author: András Simonyi <andras.simonyi@gmail.com>
Commit: András Simonyi <andras.simonyi@gmail.com>

    Finish symbol location
---
 geiser-gauche.el |  3 +--
 geiser.scm       | 22 +++++++++++-----------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/geiser-gauche.el b/geiser-gauche.el
index 9afc5f8..5f4bc75 100644
--- a/geiser-gauche.el
+++ b/geiser-gauche.el
@@ -228,7 +228,7 @@
 
 
 ;;; Manual look up
-;;; code taken from the Guile implementation 
+;;; code adapted from the Guile implementation
 
 (defun geiser-gauche--info-spec (&optional nodes)
   (let* ((nrx "^[       ]+-+ [^:]+:[    ]*")
@@ -242,7 +242,6 @@
                              (list (format "(%s)%s" node idx) nil nrx drx)))
               '("Module Index" "Class Index" "Variable Index"))))))
 
-
 (info-lookup-add-help :topic 'symbol :mode 'geiser-gauche-mode
                       :ignore-case nil
                       :regexp "[^()`',\"        \n]+"
diff --git a/geiser.scm b/geiser.scm
index 5dd7d23..a82e252 100644
--- a/geiser.scm
+++ b/geiser.scm
@@ -19,7 +19,6 @@
    ;; Missing functions:
    ;; geiser:start-server
    ;; geiser:object-signature
-   ;; geiser:symbol-location
    ;; geiser:find-file
    ;; geiser:compile
    ))
@@ -240,23 +239,24 @@
        (let1 paths (map cdr (library-fold m acons '()))
             (if (pair? paths)
                 `(("file" . ,(car paths)) ("line") ("column"))
-                ()))))
+                '(("file") ("line") ("column"))))))
 
 
 ;; Further
 
 (define (geiser:symbol-location symbol pref-module)
-  (if (find-module symbol)
-      (geiser:module-location symbol)
-      (let* ((module (or pref-module 'user))
-            (obj (global-variable-ref module symbol #f)))
-       (if (and obj (or (is-a? obj <procedure>)
-                        (is-a? obj <generic>)))
-           (let* ((sl (source-location obj))
+  (let* ((module (or pref-module 'user))
+        (obj (global-variable-ref module symbol #f)))
+    (or (and-let* (obj
+                  ((or (is-a? obj <procedure>)
+                       (is-a? obj <generic>)))
+                  (sl (source-location obj))
                   (file (car sl))
+                  ((string-contains file "/"))
+                  ((not (string-contains file "./")))
                   (line (cadr sl)))
-             `(("file" . ,file) ("line" . ,line) ("column")))
-           ()))))
+         `(("file" . ,file) ("line" . ,line) ("column")))
+       '(("file") ("line") ("column")))))
 
 ;; TODO We add the load-path at the end. Is this correct?
 (define-macro (geiser:add-to-load-path dir)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]