[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-gauche a0eee47 068/119: Correctly detect current mo
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-gauche a0eee47 068/119: Correctly detect current module in the repl |
Date: |
Sun, 1 Aug 2021 18:27:59 -0400 (EDT) |
branch: elpa/geiser-gauche
commit a0eee47bba892d71a2d96355d5edc3f780f8f8f0
Author: András Simonyi <andras.simonyi@gmail.com>
Commit: András Simonyi <andras.simonyi@gmail.com>
Correctly detect current module in the repl
---
geiser-gauche.el | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/geiser-gauche.el b/geiser-gauche.el
index a595b9d..3585393 100644
--- a/geiser-gauche.el
+++ b/geiser-gauche.el
@@ -84,8 +84,8 @@
;; (goto-char (point-max))
;; (insert (format "\nGeiser PROC: %s, ARGS: %s \n" proc args)))
(cl-case proc
- ;; Autodoc (alone) makes use of the {{cur-module}} cookie to pass current
- ;; module information
+ ;; Autodoc and symbol-location makes use of the {{cur-module}} cookie to
+ ;; pass current module information
((autodoc symbol-location)
(format "(eval '(geiser:%s %s {{cur-module}}) (find-module 'geiser))"
proc (mapconcat 'identity args " ")))
@@ -101,7 +101,9 @@
;; The {{cur-module}} cookie is replaced by the current module for
;; commands that need it
(replace-regexp-in-string
- "{{cur-module}}" module
+ "{{cur-module}}"
+ ;; module
+ (format "'%s" (geiser-gauche--get-module))
(format "(eval '(geiser:eval %s '%s) (find-module 'geiser))" module
form))))
;; The rest of the commands are all evaluated in the geiser module
(t
@@ -111,6 +113,12 @@
(defconst geiser-gauche--module-re
"(define-module +\\([[:alnum:].-]+\\)")
+(defun geiser-gauche--get-current-repl-module ()
+ (substring
+ (geiser-eval--send/result
+ '(list (list (quote result) (write-to-string (current-module)))))
+ 9 -1))
+
(defun geiser-gauche--get-module (&optional module)
(cond ((null module)
(save-excursion
@@ -119,7 +127,9 @@
(looking-at geiser-gauche--module-re)
(re-search-forward geiser-gauche--module-re nil t))
(geiser-gauche--get-module (match-string-no-properties 1))
- :f)))
+ ;; Return the repl module as fallback
+ (geiser-gauche--get-module
+ (geiser-gauche--get-current-repl-module)))))
((symbolp module) module)
((listp module) module)
((stringp module)
- [nongnu] elpa/geiser-gauche 0be6e0a 081/119: Add setup elisp file, (continued)
- [nongnu] elpa/geiser-gauche 0be6e0a 081/119: Add setup elisp file, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche a3b2e3f 009/119: Remove test line, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 0050571 021/119: Minor fix in autodoc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 7635884 020/119: Minor fix, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche c96701c 047/119: Continue work on module docs, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 54a360a 029/119: Add symbol manual lookup support, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche f5ddefb 043/119: Prefer current-module visible alternatives in autodoc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 4195803 028/119: Prefer longest require arg list in autodoc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche d5d68fd 039/119: Don't import the geiser module at startup, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 0fac12f 048/119: Improve module documentation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche a0eee47 068/119: Correctly detect current module in the repl,
Philip Kaludercic <=
- [nongnu] elpa/geiser-gauche 4890817 063/119: Add let1 and case-lambda to the syntax rules, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche d71c212 074/119: Add compile to the require list, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 34490de 078/119: Small corrections, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche aeeb8b3 080/119: Minor fix, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche dd68fc7 087/119: Update README.md, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 6dfc178 090/119: Add experimental status warning, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 1e09ad7 092/119: Finish elisp stylistic improvements, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 9e7ed54 103/119: Bump version, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche ea011ac 111/119: Remove trailing whitespaces, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 19d6d41 112/119: Comment update, Philip Kaludercic, 2021/08/01