[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-gauche 3d540b3 061/119: Symbol location work
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-gauche 3d540b3 061/119: Symbol location work |
Date: |
Sun, 1 Aug 2021 18:27:57 -0400 (EDT) |
branch: elpa/geiser-gauche
commit 3d540b3c2de3e91522cae97c9f3adcfbd971bfdf
Author: András Simonyi <andras.simonyi@gmail.com>
Commit: András Simonyi <andras.simonyi@gmail.com>
Symbol location work
---
geiser-gauche.el | 5 +++--
geiser.scm | 19 +++++++++++++++++--
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/geiser-gauche.el b/geiser-gauche.el
index 2711857..9afc5f8 100644
--- a/geiser-gauche.el
+++ b/geiser-gauche.el
@@ -86,8 +86,9 @@
(cl-case proc
;; Autodoc (alone) makes use of the {{cur-module}} cookie to pass current
;; module information
- ((autodoc) (format "(eval '(geiser:autodoc %s {{cur-module}}) (find-module
'geiser))"
- (mapconcat 'identity args " ")))
+ ((autodoc symbol-location)
+ (format "(eval '(geiser:%s %s {{cur-module}}) (find-module 'geiser))"
+ proc (mapconcat 'identity args " ")))
;; Eval and compile are (module) context sensitive
((eval compile)
(let ((module (cond ((string-equal "'()" (car args))
diff --git a/geiser.scm b/geiser.scm
index 4cd8edb..5dd7d23 100644
--- a/geiser.scm
+++ b/geiser.scm
@@ -13,6 +13,7 @@
geiser:module-completions
geiser:add-to-load-path
geiser:symbol-documentation
+ geiser:symbol-location
geiser:module-location
geiser:module-exports
;; Missing functions:
@@ -136,8 +137,8 @@
;;; Autodoc
-(define (geiser:autodoc symbols . rest)
- (map (cut formatted-autodoc <> (car rest))
+(define (geiser:autodoc symbols pref-module)
+ (map (cut formatted-autodoc <> pref-module)
symbols))
(define (formatted-autodoc symbol pref-module)
@@ -244,7 +245,21 @@
;; 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))
+ (file (car sl))
+ (line (cadr sl)))
+ `(("file" . ,file) ("line" . ,line) ("column")))
+ ()))))
+
;; TODO We add the load-path at the end. Is this correct?
(define-macro (geiser:add-to-load-path dir)
`(add-load-path ,dir :after))
+
- [nongnu] elpa/geiser-gauche 698a685 038/119: Fix eval and compile, (continued)
- [nongnu] elpa/geiser-gauche 698a685 038/119: Fix eval and compile, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 8adaf75 037/119: Improvements, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 5d8264b 033/119: Add (commented out) debugging logging of commands in *scratch*, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche a90a648 032/119: Implement module location, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 558a52e 034/119: Fix module-re, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 530f4f2 040/119: Add rest arguments to all geiser: procedures, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 206f5be 045/119: Lots of cleanups, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 6110849 067/119: Add dash to module name regex, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 060b7ee 062/119: Finish symbol location, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 9ffc5bd 058/119: Add comments, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 3d540b3 061/119: Symbol location work,
Philip Kaludercic <=
- [nongnu] elpa/geiser-gauche 2d2d29c 059/119: Reorder to silence an elisp compiler warning, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 5f4d1b5 070/119: Comment cleanup, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 362f1d1 071/119: Add LICENSE, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 9a26b8f 072/119: Aesthetic changes toward MELPA, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 83c9949 069/119: Minor improvement, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 93a7c9d 073/119: Add Cask file, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche eae0506 082/119: Finish autoload related changes, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche fb927ed 084/119: Update README.md, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche bdaeb16 097/119: Fix comletion bug, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche b8a5c0d 091/119: Minor README update, Philip Kaludercic, 2021/08/01