summaryrefslogtreecommitdiff
path: root/geiser-guile.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-11-25 02:34:58 +0000
committerjao <jao@gnu.org>2021-11-25 02:34:58 +0000
commitd24e673c5e2095f8add1fc1a72a5020f6fd18f33 (patch)
tree2eed1b84110c0e8f739632c4d88d56f7ab248c57 /geiser-guile.el
parent45097fffa6738c2e396580c87f381ca51c8789fc (diff)
downloadgeiser-guile-d24e673c5e2095f8add1fc1a72a5020f6fd18f33.tar.gz
geiser-guile-d24e673c5e2095f8add1fc1a72a5020f6fd18f33.tar.bz2
User-controlled declarative modules
Via a custom variable, as usual, and defaulting to not use them, as it provides a fuller interactive experience. Very tempted to name this flag heed-mathias-counsel-p...
Diffstat (limited to 'geiser-guile.el')
-rw-r--r--geiser-guile.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/geiser-guile.el b/geiser-guile.el
index 48ec002..6e1ddf9 100644
--- a/geiser-guile.el
+++ b/geiser-guile.el
@@ -71,6 +71,13 @@ file, using `geiser-guile-init-file' is not equivalent to setting
this variable to t."
:type 'boolean)
+(geiser-custom--defcustom geiser-guile-use-declarative-modules-p nil
+ "Whether Guile should use \"declarative\" modules limiting mutability.
+When set to `t', Guile will enforce immutable bindings in
+exported modules."
+ :type 'boolean
+ :link '(info-link "(guile) Declarative Modules"))
+
(geiser-custom--defcustom geiser-guile-debug-show-bt-p nil
"Whether to automatically show a full backtrace when entering the debugger.
If nil, only the last frame is shown."
@@ -388,6 +395,13 @@ it spawn a server thread."
'done)))
(geiser-eval--send/wait code)))
+(defun geiser-guile--set-up-declarative-modules ()
+ "Set up Guile to (not) use declarative modules.
+See `geiser-guile-use-declarative-modules-p'."
+ (unless geiser-guile-use-declarative-modules-p
+ (let ((code '(begin (eval-when (expand) (user-modules-declarative? :f)) 'ok)))
+ (geiser-eval--send/wait code))))
+
(defun geiser-guile--startup (remote)
"Startup function, for a remote connection if REMOTE is t."
(set (make-local-variable 'compilation-error-regexp-alist)
@@ -401,6 +415,7 @@ it spawn a server thread."
(or geiser-repl--last-scm-buffer
(current-buffer)))))
(when remote (geiser-guile--set-geiser-load-path))
+ (geiser-guile--set-up-declarative-modules)
(geiser-eval--send/wait ",use (geiser emacs)\n'done")
(dolist (dir g-load-path)
(let ((dir (expand-file-name dir)))