aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2025-06-07 16:35:42 +0300
committerEli Zaretskii2025-06-07 16:35:42 +0300
commit62014576dcd7fb71aa0e5dce01d451de8c24efc6 (patch)
tree72ac45820c5d87b5e11b150a9bb6d8d828911afa
parentb195ccfe892277075503f6b9c4c67a12db2632c1 (diff)
downloademacs-62014576dcd7fb71aa0e5dce01d451de8c24efc6.tar.gz
emacs-62014576dcd7fb71aa0e5dce01d451de8c24efc6.zip
Fix 'save-some-buffers' when file name has embedded '%'
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't assume the prompt will never include the '%' character. (Bug#78715)
-rw-r--r--lisp/emacs-lisp/map-ynp.el38
1 files changed, 19 insertions, 19 deletions
diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el
index fc9912f189e..9c08f8dc2eb 100644
--- a/lisp/emacs-lisp/map-ynp.el
+++ b/lisp/emacs-lisp/map-ynp.el
@@ -167,13 +167,13 @@ The function's value is the number of actions taken."
167 'quit)) 167 'quit))
168 ;; Prompt in the echo area. 168 ;; Prompt in the echo area.
169 (let ((cursor-in-echo-area (not no-cursor-in-echo-area))) 169 (let ((cursor-in-echo-area (not no-cursor-in-echo-area)))
170 (message (substitute-command-keys 170 (message "%s" (substitute-command-keys
171 (format 171 (format
172 (apply #'propertize 172 (apply #'propertize
173 "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') " 173 "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') "
174 minibuffer-prompt-properties) 174 minibuffer-prompt-properties)
175 prompt user-keys 175 prompt user-keys
176 (help-key)))) 176 (help-key))))
177 (if minibuffer-auto-raise 177 (if minibuffer-auto-raise
178 (raise-frame (window-frame (minibuffer-window)))) 178 (raise-frame (window-frame (minibuffer-window))))
179 (unwind-protect 179 (unwind-protect
@@ -194,14 +194,14 @@ The function's value is the number of actions taken."
194 (when (fboundp 'set-text-conversion-style) 194 (when (fboundp 'set-text-conversion-style)
195 (set-text-conversion-style text-conversion-style))) 195 (set-text-conversion-style text-conversion-style)))
196 ;; Show the answer to the question. 196 ;; Show the answer to the question.
197 (message (substitute-command-keys 197 (message "%s" (substitute-command-keys
198 (format 198 (format
199 "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') %s" 199 "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') %s"
200 prompt user-keys 200 prompt user-keys
201 (help-key) 201 (help-key)
202 (if (equal char -1) 202 (if (equal char -1)
203 "[end-of-keyboard-macro]" 203 "[end-of-keyboard-macro]"
204 (single-key-description char)))))) 204 (single-key-description char))))))
205 (setq def (lookup-key map (vector char)))) 205 (setq def (lookup-key map (vector char))))
206 (cond ((eq def 'exit) 206 (cond ((eq def 'exit)
207 (setq next (lambda () nil))) 207 (setq next (lambda () nil)))
@@ -276,10 +276,10 @@ Type \\`SPC' or \\`y' to %s the current %s;
276 (funcall try-again)) 276 (funcall try-again))
277 (t 277 (t
278 ;; Random char. 278 ;; Random char.
279 (message (substitute-command-keys 279 (message "%s" (substitute-command-keys
280 (format 280 (format
281 "Type \\`%s' for help" 281 "Type \\`%s' for help"
282 (help-key)))) 282 (help-key))))
283 (beep) 283 (beep)
284 (sit-for 1) 284 (sit-for 1)
285 (funcall try-again)))) 285 (funcall try-again))))