unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Drew Adams <drew.adams@oracle.com>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	Raffaele Ricciardi <rfflrccrd@gmail.com>,
	21112@debbugs.gnu.org
Subject: bug#21112: 25; Patch: show minibuffer messages with a face
Date: Thu, 27 Jun 2019 23:29:16 +0300	[thread overview]
Message-ID: <87y31n9btf.fsf@mail.linkov.net> (raw)
In-Reply-To: <2cf332e4-b80e-43f1-82e5-7d1610f72362@default> (Drew Adams's message of "Thu, 27 Jun 2019 07:22:40 -0700 (PDT)")

>> 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	other threads:[~2019-06-27 20:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-22 12:46 bug#21112: 25; Patch: show minibuffer messages with a face Raffaele Ricciardi
2015-07-22 13:42 ` Drew Adams
2015-07-22 13:44   ` Drew Adams
2015-07-22 15:27     ` Raffaele Ricciardi
2015-07-22 15:42       ` Drew Adams
2016-02-23  9:34 ` Lars Ingebrigtsen
2019-06-25 15:50   ` Lars Ingebrigtsen
2019-06-25 19:47     ` Juri Linkov
2019-06-25 20:43       ` Lars Ingebrigtsen
2019-06-26 21:28         ` Juri Linkov
2019-06-27 10:28           ` Lars Ingebrigtsen
2019-06-27 14:22             ` Drew Adams
2019-06-27 20:29               ` Juri Linkov [this message]
2019-06-27 21:19                 ` Drew Adams
2019-06-27 20:28             ` Juri Linkov
2019-06-27 21:37               ` Drew Adams
2019-07-04 22:01         ` Juri Linkov
2019-06-25 20:54       ` Drew Adams
2019-06-26 21:30         ` Juri Linkov
2019-06-26 22:13           ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y31n9btf.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=21112@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=larsi@gnus.org \
    --cc=rfflrccrd@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).