bug-gnu-emacs
[Top][All Lists]
Advanced

[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 23:29:16 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> I'm not really convinced that there should be any face properties on the
>> minibuffer messages at all, though.  :-)
>
> Yes, and a caller can always add whatever properties
> it wants/needs.  It's not hard to pass a propertized
> string to `minibuffer-message'.

It makes no sense for a caller of a particular command
to decide whether to highlight the message or not.

It should be user's preference whether to highlight
all messages from all commands, or none at all.

If the user decided "I don't want caller's highlighting",
a caller should not have the right to override user's preference.

So we should not allow a caller to overwrite the default
face properties, and I retract that part of my previous patch.

This is a better patch that uses caller's properties
only when minibuffer-message-properties is nil:

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 57702760fb..fa45616bf3 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -693,6 +693,9 @@ minibuffer
   :link '(custom-manual "(emacs)Minibuffer")
   :group 'environment)
 
+(defvar minibuffer-message-properties minibuffer-prompt-properties
+  "Text properties added to the text shown by `minibuffer-message'.")
+
 (defun minibuffer-message (message &rest args)
   "Temporarily display MESSAGE at the end of the minibuffer.
 The text is displayed for `minibuffer-message-timeout' seconds,
@@ -714,6 +717,8 @@ minibuffer-message
                       (copy-sequence message)
                     (concat " [" message "]")))
     (when args (setq message (apply #'format-message message args)))
+    (when minibuffer-message-properties
+      (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,






reply via email to

[Prev in Thread] Current Thread [Next in Thread]