[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: map-y-or-n does not use minibuffer-prompt face
From: |
Lennart Borgman (gmail) |
Subject: |
Re: map-y-or-n does not use minibuffer-prompt face |
Date: |
Sun, 25 Feb 2007 17:09:10 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 |
Lennart Borgman (gmail) wrote:
The function `map-y-or-n-p' does not use minibuffer-prompt face.
To show this start Emacs with
emacs -Q
then do
M-x customize-face RET minibuffer-prompt RET
Set Foreground to red and click "Set for Current Session". Just to check
that the prompt is colored do
M-x
Cancel the prompt and then paste this code into the *Scratch* buffer and
eval it:
(map-y-or-n-p
"Prompt should have minibuffer-prompt face, object=%s? "
(function
(lambda(object)
(message "object=%s" object)))
'("a" "b"))
The prompt will not be colored.
Here is a patch for this. I would be glad if someone installed it. As
usual I do not want to touch for CVS at this time.
Index: map-ynp.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/map-ynp.el,v
retrieving revision 1.9
diff -u -r1.9 map-ynp.el
--- map-ynp.el 21 Jan 2007 02:44:24 -0000 1.9
+++ map-ynp.el 25 Feb 2007 16:05:54 -0000
@@ -149,9 +149,14 @@
;; Prompt in the echo area.
(let ((cursor-in-echo-area (not no-cursor-in-echo-area))
(message-log-max nil))
- (message "%s(y, n, !, ., q, %sor %s) "
- prompt user-keys
- (key-description (vector help-char)))
+ (let ((prompt-with-face
+ (format "%s(y, n, !, ., q, %sor %s) "
+ prompt user-keys
+ (key-description (vector
help-char)))))
+ (add-text-properties
+ 0 (length prompt-with-face)
+ minibuffer-prompt-properties prompt-with-face)
+ (message "%s" prompt-with-face))
(if minibuffer-auto-raise
(raise-frame (window-frame (minibuffer-window))))
(while (progn