summaryrefslogtreecommitdiff
path: root/lisp/printing.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-09-06 23:44:09 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-06 23:44:09 +0200
commit816975f4bbf906c838753e7e43f74b5a190376b6 (patch)
tree7a1d36d9a5aa80d677a0cf01a9174b85e28e011d /lisp/printing.el
parent1b390c3cbf996d7d77e3c2d823ca891b8c0f09c6 (diff)
downloademacs-816975f4bbf906c838753e7e43f74b5a190376b6.tar.gz
Use format-prompt in some read-string calls
* lisp/progmodes/prolog.el (prolog-help-on-predicate): * lisp/cmuscheme.el (scheme-trace-procedure): * lisp/calendar/todo-mode.el (todo-convert-legacy-files): Use format-prompt in some read-string calls (that have default values). * lisp/printing.el (pr-interactive-regexp): No need to use "" as the default value, because that's the default default value. (pr-interactive-n-up): Use read-number instead of read-string and then parsing the string.
Diffstat (limited to 'lisp/printing.el')
-rw-r--r--lisp/printing.el30
1 files changed, 13 insertions, 17 deletions
diff --git a/lisp/printing.el b/lisp/printing.el
index b8879befae3..86a2434c0da 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -5284,22 +5284,18 @@ If menu binding was not done, calls `pr-menu-bind'."
(defun pr-interactive-n-up (mess)
- (or (stringp mess) (setq mess "*"))
- (save-match-data
- (let* ((fmt-prompt "%s[%s] N-up printing (default 1): ")
- (prompt "")
- (str (read-string (format fmt-prompt prompt mess) nil nil "1"))
- int)
- (while (if (string-match "^\\s *[0-9]+$" str)
- (setq int (string-to-number str)
- prompt (cond ((< int 1) "Integer below 1; ")
- ((> int 100) "Integer above 100; ")
- (t nil)))
- (setq prompt "Invalid integer syntax; "))
- (ding)
- (setq str
- (read-string (format fmt-prompt prompt mess) str nil "1")))
- int)))
+ (unless (stringp mess)
+ (setq mess "*"))
+ (let (int)
+ (while (or (< (setq int (read-number (format "[%s] N-up printing:" mess) 1))
+ 0)
+ (> int 100))
+ (if (< int 0)
+ (message "Integer below 1")
+ (message "Integer above 100"))
+ (sit-for 1)
+ (ding))
+ int))
(defun pr-interactive-dir (mess)
@@ -5323,7 +5319,7 @@ If menu binding was not done, calls `pr-menu-bind'."
(defun pr-interactive-regexp (mess)
- (read-string (format "[%s] File regexp to print: " mess) nil nil ""))
+ (read-string (format "[%s] File regexp to print: " mess)))
(defun pr-interactive-dir-args (mess)