I couldn't find anything on this, so I'm asking it here. I can display a message in minibuffer with
(message "foo bar")
I would like to give only the message "foo bar" a red color in the minibuffer. Is that possible with Emacs?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityI couldn't find anything on this, so I'm asking it here. I can display a message in minibuffer with
(message "foo bar")
I would like to give only the message "foo bar" a red color in the minibuffer. Is that possible with Emacs?
Just use a string with faces.
(message (propertize "foo bar" 'face 'highlight))
Or use a different face, which has a red foreground. Or use a face property list:
(message (propertize "foo bar" 'face '(:foreground "Red")))
#("foo bar" 0 7 (face highlight))
in the echo area, but this answer explained why - you can't use C-x C-e to test it out... emacs.stackexchange.com/questions/2331/…
– Brian Burns
Dec 15 '15 at 17:36
M-x customiz-group RET minibuffer RET
you can customize various aspects of how things appear in theminibuffer
. Not sure if it is what you want, but it would be a good place to start. I am not entirely sure if you want to do this as part of some commands that you are writing, or just a general way to customize the face of the text in the minibuffer. – elethan Dec 15 '15 at 15:15