>From 9ea712779d725a23fe8f4acd7b934b0a64a1f1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Mon, 6 May 2019 21:26:37 +0200 Subject: [PATCH] Make y-or-no-p keep the supplied prompt's face * lisp/subr.el (y-or-n-p): append the minibuffer-prompt face instead of overwriting the prompt's face property. --- lisp/subr.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index f68f9dd419..8d224ff5bb 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2647,11 +2647,15 @@ y-or-n-p (let ((cursor-in-echo-area t)) (when minibuffer-auto-raise (raise-frame (window-frame (minibuffer-window)))) - (read-key (propertize (if (memq answer scroll-actions) - prompt - (concat "Please answer y or n. " - prompt)) - 'face 'minibuffer-prompt))))) + (read-key + (let ((prompt-maybe-please + (if (memq answer scroll-actions) + prompt + (concat "Please answer y or n. " prompt)))) + (add-face-text-property + 0 (1- (length prompt-maybe-please)) + 'minibuffer-prompt t prompt-maybe-please) + prompt-maybe-please))))) (setq answer (lookup-key query-replace-map (vector key) t)) (cond ((memq answer '(skip act)) nil) -- 2.21.0