diff options
| author | Juri Linkov <juri@linkov.net> | 2019-11-10 00:32:09 +0200 |
|---|---|---|
| committer | Juri Linkov <juri@linkov.net> | 2019-11-10 00:32:09 +0200 |
| commit | 027f218ad227c3966df94b22566c2e89a307362d (patch) | |
| tree | adab0d405b32bfaa7a54c6623c1402c00837035e /lisp/files.el | |
| parent | 04ab67470706f1c66bdf08e4078ea3dffd79b41e (diff) | |
| download | emacs-027f218ad227c3966df94b22566c2e89a307362d.tar.gz | |
hack-local-variables-confirm uses the minibuffer to read answer (bug#38076)
* lisp/files.el (hack-local-variables-confirm):
Use read-char-from-minibuffer instead of read-char-choice.
Remove special handling of original window scrolling
that is now supported in the minibuffer. This fixes
https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg01020.html
(files--ask-user-about-large-file): Use read-char-from-minibuffer
instead of read-char-choice.
Diffstat (limited to 'lisp/files.el')
| -rw-r--r-- | lisp/files.el | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lisp/files.el b/lisp/files.el index f7726b566a9..24b882ede26 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2120,7 +2120,7 @@ think it does, because \"free\" is pretty hard to define in practice." ("Yes" . ?y) ("No" . ?n) ("Open literally" . ?l))) - (read-char-choice + (read-char-from-minibuffer (concat prompt " (y)es or (n)o or (l)iterally ") '(?y ?Y ?n ?N ?l ?L))))) (cond ((memq choice '(?y ?Y)) nil) @@ -3503,24 +3503,16 @@ n -- to ignore the local variables list.") ;; Display the buffer and read a choice. (save-window-excursion (pop-to-buffer buf '(display-buffer--maybe-at-bottom)) - (let* ((exit-chars '(?y ?n ?\s ?\C-g ?\C-v)) + (let* ((exit-chars '(?y ?n ?\s)) (prompt (format "Please type %s%s: " (if offer-save "y, n, or !" "y or n") (if (< (line-number-at-pos (point-max)) (window-body-height)) "" - (push ?\C-v exit-chars) - ", or C-v to scroll"))) + ", or C-v/M-v to scroll"))) char) (if offer-save (push ?! exit-chars)) - (while (null char) - (setq char (read-char-choice prompt exit-chars t)) - (when (eq char ?\C-v) - (condition-case nil - (scroll-up) - (error (goto-char (point-min)) - (recenter 1))) - (setq char nil))) + (setq char (read-char-from-minibuffer prompt exit-chars)) (when (and offer-save (= char ?!) unsafe-vars) (customize-push-and-save 'safe-local-variable-values unsafe-vars)) (prog1 (memq char '(?! ?\s ?y)) |
