Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a quiet option to mute banner #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions editor.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,21 @@

(defvar *announced* nil)

(defun make-editor (&rest args)
(defun make-editor (&rest args &key quiet &allow-other-keys)
(ti:set-terminal)
(let* ((type (if (smart-terminal-p)
'smart-editor
'dumb-editor))
(spec (list *version* type)))
(unless (equal *announced* spec)
(format t "~&Linedit version ~A, ~A mode, ESC-h for help.~%"
*version*
(if (eq 'smart-editor type)
"smart"
"dumb"))
(setf *announced* spec))
(unless quiet
(unless (equal *announced* spec)
(format t "~&Linedit version ~A, ~A mode, ESC-h for help.~%"
*version*
(if (eq 'smart-editor type)
"smart"
"dumb"))
(setf *announced* spec)))
(remf args :quiet)
(apply 'make-instance type args)))

;;; undo
Expand Down
4 changes: 2 additions & 2 deletions main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

(defvar *editor* nil)

(defun linedit (&rest keyword-args &key prompt history killring &allow-other-keys)
(defun linedit (&rest keyword-args &key prompt history killring quiet &allow-other-keys)
"Reads a single line of input with line-editing from standard input
of the process and returns it as a string.

Expand Down Expand Up @@ -73,7 +73,7 @@ completion."

(defvar *level* 0)

(defun formedit (&rest args &key (prompt1 "") (prompt2 "") history killring
(defun formedit (&rest args &key (prompt1 "") (prompt2 "") history killring quiet
&allow-other-keys)
"Reads a single form (s-expession) of input with line-editing from
standard input of the process and returns it as a string.
Expand Down