mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
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
This commit is contained in:
parent
78e9e51065
commit
8d21dd7eb8
1 changed files with 8 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
||||||
#:use-module (system repl common)
|
#:use-module (system repl common)
|
||||||
#:use-module (system repl command)
|
#:use-module (system repl command)
|
||||||
#:use-module (ice-9 control)
|
#:use-module (ice-9 control)
|
||||||
#:export (start-repl run-repl))
|
#:export (start-repl run-repl %inhibit-welcome-message))
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
|
@ -127,6 +127,11 @@
|
||||||
;;; The repl
|
;;; 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)
|
(define* (start-repl #:optional (lang (current-language)) #:key debug)
|
||||||
(start-repl* lang debug prompting-meta-read))
|
(start-repl* lang debug prompting-meta-read))
|
||||||
|
|
||||||
|
@ -158,7 +163,8 @@
|
||||||
|
|
||||||
(% (with-fluids ((*repl-stack*
|
(% (with-fluids ((*repl-stack*
|
||||||
(cons repl (or (fluid-ref *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))
|
(repl-welcome repl))
|
||||||
(let prompt-loop ()
|
(let prompt-loop ()
|
||||||
(let ((exp (prompting-meta-read repl)))
|
(let ((exp (prompting-meta-read repl)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue