[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile c8dcc24 202/284: Make do with a single connec
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile c8dcc24 202/284: Make do with a single connection |
Date: |
Sun, 1 Aug 2021 18:29:45 -0400 (EDT) |
branch: elpa/geiser-guile
commit c8dcc2472b230bf1c0b17b78369c516fe802aea5
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Make do with a single connection
Separate connections for the REPL and Geiser commands was kind of
neat, but it had the problem of synchronising the current namespace
for both connections. A quick fix would have been to ask the scheme
for the current namespace for every Geiser command in the REPL, but
that, besides clunky, would add potentially prohibitive overhead for
(real) remote connections.
As it happens, using a single connection turned out to be not that
difficult and relatively clean code-wise. We could even turn back to
not use inferior schemes, and the net result of this refactoring would
be the replacement of comint-redirect (which wasn't able to match the
whole EOT token if it didn't arrive all at once) by transaction queues
(which also makes geiser-connection's implementation cleaner).
But using an inferior scheme has a dog-food value, and allows external
processes to connect to the scheme being used by Geiser without
further ado, which could be useful for debugging (although this is a
lame excuse: nothing prevents you from starting a REPL server from
emacs if you want). We'll see.
---
elisp/geiser-guile.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index 3d42d24..687bf34 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -174,13 +174,11 @@ This function uses `geiser-guile-init-file' if it exists."
;;; Error display
(defun geiser-guile--enter-debugger ()
- (let ((bt-cmd (format ",%s\n"
+ (let ((bt-cmd (format ",geiser-newline\n,error-message\n,%s\n"
(if geiser-guile-debug-show-bt-p "bt" "fr"))))
(compilation-forget-errors)
(goto-char (point-max))
- (geiser-repl--swap)
- (comint-send-string nil ",geiser-newline\n")
- (comint-send-string nil ",error-message\n")
+ (geiser-repl--prepare-send)
(comint-send-string nil bt-cmd)
(when geiser-guile-show-debug-help-p
(message "Debug REPL. Enter ,q to quit, ,h for help."))
@@ -266,10 +264,16 @@ it spawn a server thread."
(when remote
(geiser-repl--send-silent (geiser-guile--load-path-string))
(geiser-repl--send-silent ",use (geiser emacs)"))
- (geiser-guile-update-warning-level))
-
-(defconst geiser-guile--init-server-command
- ",use (geiser emacs)\n,geiser-start-server")
+ (geiser-guile-update-warning-level)
+ )
+
+(defun geiser-guile--init-server-command ()
+ (comint-kill-region (point-min) (point-max))
+ (setq comint-prompt-regexp "inferior-guile> ")
+ (comint-send-string nil ",option prompt \"inferior-guile> \"\n")
+ (comint-send-string nil ",use (geiser emacs)\n")
+ (geiser-inf--wait-for-prompt 10000)
+ ",geiser-start-server")
;;; Implementation definition:
- [nongnu] elpa/geiser-guile 8bf1a8b 268/284: Fix indentation, (continued)
- [nongnu] elpa/geiser-guile 8bf1a8b 268/284: Fix indentation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile ba4c1a9 276/284: adjustments to scheme load path, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 700ac98 282/284: Use new implementation extension declarator., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 5e2c874 139/284: Golfing., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 06d7cf5 144/284: Guile: taking advantage of the patterns property in macro transformers., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3a80209 164/284: Guile: evaluation warnings, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7563473 167/284: Guile: configurable warning level, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 17ebbec 183/284: Autodoc: fix for improper macro arglists scanning, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 04fd67f 185/284: Always fallback to edit-module in M-., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile cd2cfae 190/284: Guile: better meta-command args handling, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile c8dcc24 202/284: Make do with a single connection,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile fef0d8a 209/284: Document browser improvements, and Racket using them, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 190290b 213/284: Guile: fixes for documentation display, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6d69176 216/284: No more interning in the scheme reader, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile b9a8980 224/284: Guile: what if i do what i meant to do?, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d6fca59 232/284: guile: lambda* indentation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 15af81d 247/284: Add 'geiser-syntax--simple-keywords', Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 362354d 241/284: Indent Guile's `with-mutex', Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 9fb965f 251/284: Add more highlighting/indentation for Guile, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile be00e7a 261/284: guile: fix manual symbol lookup., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile e975e10 263/284: guile 2.2: program-arities and program-module reloaded, Philip Kaludercic, 2021/08/01