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 00:30:33 +0300	[thread overview]
Message-ID: <877e98t592.fsf@mail.linkov.net> (raw)
In-Reply-To: <85ec41db-186f-4ab7-8660-5561f4599a27@default> (Drew Adams's message of "Tue, 25 Jun 2019 13:54:10 -0700 (PDT)")

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

>> 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:
>
> 1. If you go that route, which lets libraries and
> users easily change the properties (good), please
> separate Isearch and `minibuffer-message'.  Use two
> different variables.  They are not the same species.
>
> The default value could be, but it need not be,
> the same for both.

OK, implemented in the following patch.

> On the other hand, it could be helpful to separate
> out property `face', defining an actual face (for
> each of Isearch and `minibuffer-message') that
> users can customize for this.  That also has the
> benefit that one can inherit from one to the other.
>
> The other properties would be applied first, so that
> if `face' is among them for some reason it will be
> overridden by the face provided specifically for this.

There are already too many faces in M-x list-faces-display
for users to comprehend that adding three more faces with
the same color would make matters worse.

> 2. The doc string of `minibuffer-message-properties'
> should not say that the properties are added to
> "minibuffer messages" - that's too broad.  It should
> say that they are added to the text shown by function
> `minibuffer-message' - or else describe that text,
> and only that text, in another way.

OK, fixed in the attached patch.

> The doc string of the similar variable for Isearch
> should say that the properties are added to "the
> search prompt" or some such.  Not sure whether the
> right description is "prompt", but whatever is the
> best way to describe it should be used in the doc
> string.

OK, added to this patch:


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

diff --git a/lisp/isearch.el b/lisp/isearch.el
index f150a3bba4..94c30eb57b 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1992,13 +1992,17 @@ isearch-define-mode-toggle
   (setq isearch-regexp (not isearch-regexp))
   (if isearch-regexp (setq isearch-regexp-function nil)))
 
+(defvar isearch-message-properties minibuffer-prompt-properties
+  "Text properties that are added to the isearch prompt.")
+
 (defun isearch--momentary-message (string)
   "Print STRING at the end of the isearch prompt for 1 second"
   (let ((message-log-max nil))
     (message "%s%s%s"
              (isearch-message-prefix nil isearch-nonincremental)
              isearch-message
-             (propertize (format " [%s]" string) 'face 'minibuffer-prompt)))
+             (apply #'propertize (format " [%s]" string)
+                    isearch-message-properties)))
   (sit-for 1))
 
 (isearch-define-mode-toggle lax-whitespace " " nil
@@ -3202,18 +3206,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)))
+	   isearch-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))
+	 isearch-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..9a473b6867 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,

  reply	other threads:[~2019-06-26 21:30 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
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 [this message]
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=877e98t592.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).