+++
*** 'y-or-n-p' now uses the minibuffer to read 'y' or 'n' answer.
+*** Some commands that previously used read-char-choice now read
+a character using the minibuffer by read-char-from-minibuffer.
+
** map.el
*** Now also understands plists.
*** Now defined via generic functions that can be extended via 'cl-defmethod'.
("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)
;; 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))