From 6203d45270b38215e8f7d2d14c3342796e3e9365 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 7 Jun 2025 16:35:42 +0300 Subject: [PATCH] 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) (cherry picked from commit 62014576dcd7fb71aa0e5dce01d451de8c24efc6) --- lisp/emacs-lisp/map-ynp.el | 38 +++++++++++++++++++------------------- 1 file 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." 'quit)) ;; Prompt in the echo area. (let ((cursor-in-echo-area (not no-cursor-in-echo-area))) - (message (substitute-command-keys - (format - (apply #'propertize - "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') " - minibuffer-prompt-properties) - prompt user-keys - (help-key)))) + (message "%s" (substitute-command-keys + (format + (apply #'propertize + "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') " + minibuffer-prompt-properties) + prompt user-keys + (help-key)))) (if minibuffer-auto-raise (raise-frame (window-frame (minibuffer-window)))) (unwind-protect @@ -194,14 +194,14 @@ The function's value is the number of actions taken." (when (fboundp 'set-text-conversion-style) (set-text-conversion-style text-conversion-style))) ;; Show the answer to the question. - (message (substitute-command-keys - (format - "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') %s" - prompt user-keys - (help-key) - (if (equal char -1) - "[end-of-keyboard-macro]" - (single-key-description char)))))) + (message "%s" (substitute-command-keys + (format + "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') %s" + prompt user-keys + (help-key) + (if (equal char -1) + "[end-of-keyboard-macro]" + (single-key-description char)))))) (setq def (lookup-key map (vector char)))) (cond ((eq def 'exit) (setq next (lambda () nil))) @@ -276,10 +276,10 @@ Type \\`SPC' or \\`y' to %s the current %s; (funcall try-again)) (t ;; Random char. - (message (substitute-command-keys - (format - "Type \\`%s' for help" - (help-key)))) + (message "%s" (substitute-command-keys + (format + "Type \\`%s' for help" + (help-key)))) (beep) (sit-for 1) (funcall try-again)))) -- 2.39.5