diff options
author | Matthew Wette <mwette@alumni.caltech.edu> | 2024-10-07 17:28:27 -0700 |
---|---|---|
committer | Arne Babenhauserheide <arne_bab@web.de> | 2024-10-12 13:16:35 +0200 |
commit | 8d21dd7eb800868909b694c774015291f8e3aa90 (patch) | |
tree | eaf8987e1ef8bd0fbfe717438b4c1ea09eac3d71 /module/system | |
parent | 78e9e51065c23bc755e669295c46537a5e988791 (diff) | |
download | guile-8d21dd7eb800868909b694c774015291f8e3aa90.tar.gz |
Create procedure to enable silencing the Guile welcome message. * module/system/repl/repl.scm: add parameter `%inhibit-welcome-message' * module/system/repl/repl.scm(run-repl*): add condition for calling procedure repl-welcome: if (%inhibit-welcome-message) is `#t', don't
Diffstat (limited to 'module/system')
-rw-r--r-- | module/system/repl/repl.scm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/module/system/repl/repl.scm b/module/system/repl/repl.scm index d83d28759..fc525b547 100644 --- a/module/system/repl/repl.scm +++ b/module/system/repl/repl.scm @@ -26,7 +26,7 @@ #:use-module (system repl common) #:use-module (system repl command) #:use-module (ice-9 control) - #:export (start-repl run-repl)) + #:export (start-repl run-repl %inhibit-welcome-message)) ;;; @@ -127,6 +127,11 @@ ;;; The repl ;;; +;; Provide a hook for users to inhibit the welcome message. +;; For example, .guile might include +;; ((@ (system repl repl) %inhibit-welcome-message) #f) +(define %inhibit-welcome-message (make-parameter #f)) + (define* (start-repl #:optional (lang (current-language)) #:key debug) (start-repl* lang debug prompting-meta-read)) @@ -158,7 +163,8 @@ (% (with-fluids ((*repl-stack* (cons repl (or (fluid-ref *repl-stack*) '())))) - (if (null? (cdr (fluid-ref *repl-stack*))) + (if (and (null? (cdr (fluid-ref *repl-stack*))) + (not (%inhibit-welcome-message))) (repl-welcome repl)) (let prompt-loop () (let ((exp (prompting-meta-read repl))) |