[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#21112: 25; Patch: show minibuffer messages with a face
From: |
Juri Linkov |
Subject: |
bug#21112: 25; Patch: show minibuffer messages with a face |
Date: |
Thu, 27 Jun 2019 00:28:06 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
>>>> I think it might be a good idea to use a different face for these
>>>> temporary messages, but you can currently do this:
>>>>
>>>> (minibuffer-message (propertize "Foo" 'face 'bold))
>>>
>>> So I don't think this is something that we want; closing the bug report.
>>
>> For consistency with isearch messages that are highlighted with the
>> minibuffer-prompt face, minibuffer-message needs to do the same.
>
> [...]
>
>> + (setq message (apply #'propertize message
>> minibuffer-message-properties))
>
> But this will overwrite the face properties the caller has set, right?
This patch checks for existing face properties to not overwrite them:
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 57702760fb..9a473b6867 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -714,6 +717,9 @@ minibuffer-message
(copy-sequence message)
(concat " [" message "]")))
(when args (setq message (apply #'format-message message args)))
+ ;; If not already propertized:
+ (unless (or (text-properties-at 0 message) (next-property-change 0
message))
+ (setq message (apply #'propertize message
minibuffer-message-properties)))
(let ((ol (make-overlay (point-max) (point-max) nil t t))
;; A quit during sit-for normally only interrupts the sit-for,
;; but since minibuffer-message is used at the end of a command,
bug#21112: 25; Patch: show minibuffer messages with a face, Drew Adams, 2019/06/25