[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master ef77070727 2/2: * lisp/subr.el (read-char-from-minibuffer, y-or-n
From: |
Juri Linkov |
Subject: |
master ef77070727 2/2: * lisp/subr.el (read-char-from-minibuffer, y-or-n-p): Simplify to use HIST=t. |
Date: |
Sun, 17 Jul 2022 14:07:30 -0400 (EDT) |
branch: master
commit ef77070727f262d9cecefd8a204c49a47ce4fc45
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
* lisp/subr.el (read-char-from-minibuffer, y-or-n-p): Simplify to use
HIST=t.
---
lisp/subr.el | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/lisp/subr.el b/lisp/subr.el
index ef2edcff10..ca4d52535a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3306,9 +3306,7 @@ while calling this function, then pressing `help-char'
causes it to evaluate `help-form' and display the result.
There is no need to explicitly add `help-char' to CHARS;
`help-char' is bound automatically to `help-form-show'."
- (defvar empty-history)
- (let* ((empty-history '())
- (map (if (consp chars)
+ (let* ((map (if (consp chars)
(or (gethash (list help-form (cons help-char chars))
read-char-from-minibuffer-map-hash)
(let ((map (make-sparse-keymap))
@@ -3335,9 +3333,7 @@ There is no need to explicitly add `help-char' to CHARS;
read-char-from-minibuffer-map))
;; Protect this-command when called from pre-command-hook (bug#45029)
(this-command this-command)
- (result
- (read-from-minibuffer prompt nil map nil
- (or history 'empty-history)))
+ (result (read-from-minibuffer prompt nil map nil (or history t)))
(char
(if (> (length result) 0)
;; We have a string (with one character), so return the first
one.
@@ -3538,9 +3534,7 @@ like) while `y-or-n-p' is running)."
(discard-input)))
(t
(setq prompt (funcall padded prompt))
- (defvar empty-history)
- (let* ((empty-history '())
- (enable-recursive-minibuffers t)
+ (let* ((enable-recursive-minibuffers t)
(msg help-form)
(keymap (let ((map (make-composed-keymap
y-or-n-p-map query-replace-map)))
@@ -3557,7 +3551,7 @@ like) while `y-or-n-p' is running)."
(this-command this-command)
(str (read-from-minibuffer
prompt nil keymap nil
- (or y-or-n-p-history-variable 'empty-history))))
+ (or y-or-n-p-history-variable t))))
(setq answer (if (member str '("y" "Y")) 'act 'skip)))))
(let ((ret (eq answer 'act)))
(unless noninteractive