unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 21112@debbugs.gnu.org, Raffaele Ricciardi <rfflrccrd@gmail.com>
Subject: bug#21112: 25; Patch: show minibuffer messages with a face
Date: Tue, 25 Jun 2019 22:47:06 +0300	[thread overview]
Message-ID: <87pnn11nm5.fsf@mail.linkov.net> (raw)
In-Reply-To: <m336jx64v9.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 25 Jun 2019 17:50:50 +0200")

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

>>>      (when args (setq message (apply 'format message args)))
>>> +    (setq message (propertize message 'face 'minibuffer-prompt))
>>
>> 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.

But since a message is displayed at different part of the minibuffer,
it should be highlighted using a new separate customizable variable
similar to minibuffer-prompt-properties:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: minibuffer-message-properties.patch --]
[-- Type: text/x-diff, Size: 2465 bytes --]

diff --git a/lisp/isearch.el b/lisp/isearch.el
index bb29c2914b..b527a210ac 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1996,7 +1996,7 @@ isearch--momentary-message
     (message "%s%s%s"
              (isearch-message-prefix nil isearch-nonincremental)
              isearch-message
-             (propertize (format " [%s]" string) 'face 'minibuffer-prompt)))
+             (apply #'propertize (format " [%s]" string) minibuffer-message-properties)))
   (sit-for 1))
 
 (isearch-define-mode-toggle lax-whitespace " " nil
@@ -3200,18 +3200,18 @@ isearch-message-prefix
 			(concat " [" current-input-method-title "]: "))
 		     ": ")
 		   )))
-    (propertize (concat (isearch-lazy-count-format)
+    (apply #'propertize (concat (isearch-lazy-count-format)
                         (upcase (substring m 0 1)) (substring m 1))
-		'face 'minibuffer-prompt)))
+	   minibuffer-message-properties)))
 
 (defun isearch-message-suffix (&optional c-q-hack)
-  (propertize (concat (if c-q-hack "^Q" "")
+  (apply #'propertize (concat (if c-q-hack "^Q" "")
 		      (isearch-lazy-count-format 'suffix)
 		      (if isearch-error
 			  (concat " [" isearch-error "]")
 			"")
 		      (or isearch-message-suffix-add ""))
-	      'face 'minibuffer-prompt))
+	 minibuffer-message-properties))
 
 (defun isearch-lazy-count-format (&optional suffix-p)
   "Format the current match number and the total number of matches.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 57702760fb..5f3986697b 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 that are added to minibuffer messages.")
+
 (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,7 @@ minibuffer-message
                       (copy-sequence message)
                     (concat " [" message "]")))
     (when args (setq message (apply #'format-message message args)))
+    (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-25 19:47 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 [this message]
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
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=87pnn11nm5.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=21112@debbugs.gnu.org \
    --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).