summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2021-01-27 11:42:30 +0200
committerJuri Linkov <juri@linkov.net>2021-01-27 11:42:30 +0200
commit08574a7f40f27ad29efb8f7d975012ecc9111717 (patch)
tree94dc5d9abf3f06411ed38dcff0913ddb2ef490ac
parentfb05199b0bf2055d75b7eba52c3ab2fd49d38509 (diff)
downloademacs-08574a7f40f27ad29efb8f7d975012ecc9111717.tar.gz
emacs-08574a7f40f27ad29efb8f7d975012ecc9111717.tar.bz2
emacs-08574a7f40f27ad29efb8f7d975012ecc9111717.zip
* lisp/subr.el (empty-history): Move defvar to functions where it's used.
-rw-r--r--lisp/subr.el6
1 files changed, 2 insertions, 4 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index f249ec3578c..afa73c72eaa 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2965,8 +2965,6 @@ Also discard all previous input in the minibuffer."
(minibuffer-message "Wrong answer")
(sit-for 2)))
-(defvar empty-history)
-
(defun read-char-from-minibuffer (prompt &optional chars history)
"Read a character from the minibuffer, prompting for it with PROMPT.
Like `read-char', but uses the minibuffer to read and return a character.
@@ -2981,6 +2979,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)
(or (gethash (list help-form (cons help-char chars))
@@ -3093,8 +3092,6 @@ Also discard all previous input in the minibuffer."
"Prefer `read-key' when answering a \"y or n\" question by `y-or-n-p'.
Otherwise, use the minibuffer.")
-(defvar empty-history)
-
(defun y-or-n-p (prompt)
"Ask user a \"y or n\" question.
Return t if answer is \"y\" and nil if it is \"n\".
@@ -3190,6 +3187,7 @@ is nil and `use-dialog-box' is non-nil."
(discard-input)))
(t
(setq prompt (funcall padded prompt))
+ (defvar empty-history)
(let* ((empty-history '())
(enable-recursive-minibuffers t)
(msg help-form)