From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#21112: 25; Patch: show minibuffer messages with a face Date: Thu, 27 Jun 2019 00:30:33 +0300 Organization: LINKOV.NET Message-ID: <877e98t592.fsf@mail.linkov.net> References: <55AF90B9.5040401@gmail.com> <87si0jvkgv.fsf@gnus.org> <87pnn11nm5.fsf@mail.linkov.net> <85ec41db-186f-4ab7-8660-5561f4599a27@default> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="172818"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , Raffaele Ricciardi , 21112@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 26 23:38:29 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgFcZ-000imY-Ux for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Jun 2019 23:38:28 +0200 Original-Received: from localhost ([::1]:45050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgFcX-0006tm-WD for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Jun 2019 17:38:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54318) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgFcC-0006kf-N8 for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2019 17:38:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgFcB-0007Cs-9L for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2019 17:38:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51827) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgFcB-0007Cl-42 for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2019 17:38:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hgFcB-0003LG-1D for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2019 17:38:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jun 2019 21:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21112 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix patch Original-Received: via spool by 21112-submit@debbugs.gnu.org id=B21112.156158507912815 (code B ref 21112); Wed, 26 Jun 2019 21:38:02 +0000 Original-Received: (at 21112) by debbugs.gnu.org; 26 Jun 2019 21:37:59 +0000 Original-Received: from localhost ([127.0.0.1]:37135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgFc7-0003Kd-3M for submit@debbugs.gnu.org; Wed, 26 Jun 2019 17:37:59 -0400 Original-Received: from antelope.elm.relay.mailchannels.net ([23.83.212.4]:13245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgFc2-0003KQ-3g for 21112@debbugs.gnu.org; Wed, 26 Jun 2019 17:37:54 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 0467E6A2684; Wed, 26 Jun 2019 21:37:53 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a82.g.dreamhost.com (100-96-89-88.trex.outbound.svc.cluster.local [100.96.89.88]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 729196A26B8; Wed, 26 Jun 2019 21:37:52 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a82.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Wed, 26 Jun 2019 21:37:52 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Coil-Descriptive: 356fc2125a1c0fc5_1561585072826_1580450319 X-MC-Loop-Signature: 1561585072826:1508649501 X-MC-Ingress-Time: 1561585072826 Original-Received: from pdx1-sub0-mail-a82.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a82.g.dreamhost.com (Postfix) with ESMTP id 63A5F80F8F; Wed, 26 Jun 2019 14:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=p/halKLjW7saLh6UaVNZ0Ti/B0A=; b= oymwShLymqB1hel/ClZQYYdmwAlxbzpBmCePopTltxUAdWrjAi8YV5lXn+cq0ydL 3AYs/6tY+kXu56RqOhAPYVZ1dbXgWact9rkeDQpd3p7iMqBB/5SLXkSekJra67zc rYFaqIkBJlWcRNDsFG2RMB2ThxxVUZizrdB39aCniZ4= Original-Received: from mail.jurta.org (m91-129-109-209.cust.tele2.ee [91.129.109.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a82.g.dreamhost.com (Postfix) with ESMTPSA id C425E80F63; Wed, 26 Jun 2019 14:37:45 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a82 In-Reply-To: <85ec41db-186f-4ab7-8660-5561f4599a27@default> (Drew Adams's message of "Tue, 25 Jun 2019 13:54:10 -0700 (PDT)") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrudejgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtledrvddtleenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdelrddvtdelpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughrvgifrdgruggrmhhssehorhgrtghlvgdrtghomhenucevlhhushhtvghrufhiiigvpedu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161545 Archived-At: --=-=-= Content-Type: text/plain >> 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=minibuffer-message-properties.2.patch 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, --=-=-=--