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 23:29:16 +0300 Organization: LINKOV.NET Message-ID: <87y31n9btf.fsf@mail.linkov.net> References: <55AF90B9.5040401@gmail.com> <87si0jvkgv.fsf@gnus.org> <87pnn11nm5.fsf@mail.linkov.net> <87y31orqm1.fsf@mail.linkov.net> <2cf332e4-b80e-43f1-82e5-7d1610f72362@default> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="10159"; 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 Thu Jun 27 23:09:12 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 1hgbdm-0002TS-Of for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jun 2019 23:09:11 +0200 Original-Received: from localhost ([::1]:54606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgbdk-0008TW-IS for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jun 2019 17:09:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48151) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgb8i-0001S2-4w for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 16:37:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgb8g-0001PW-Su for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 16:37:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54529) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgb8g-0001P7-Me for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 16:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hgb8g-0006P5-Is for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 16:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Jun 2019 20:37: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.156166777324519 (code B ref 21112); Thu, 27 Jun 2019 20:37:02 +0000 Original-Received: (at 21112) by debbugs.gnu.org; 27 Jun 2019 20:36:13 +0000 Original-Received: from localhost ([127.0.0.1]:39836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgb7s-0006NI-5B for submit@debbugs.gnu.org; Thu, 27 Jun 2019 16:36:12 -0400 Original-Received: from bird.elm.relay.mailchannels.net ([23.83.212.17]:24691) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgb7o-0006N3-3k for 21112@debbugs.gnu.org; Thu, 27 Jun 2019 16:36:08 -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 158BA340736; Thu, 27 Jun 2019 20:36:07 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a2.g.dreamhost.com (100-96-28-110.trex.outbound.svc.cluster.local [100.96.28.110]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4B5AF340D3C; Thu, 27 Jun 2019 20:36:06 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a2.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); Thu, 27 Jun 2019 20:36:06 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Wipe-Tasty: 21cb865216992905_1561667766645_3372373032 X-MC-Loop-Signature: 1561667766645:2301289759 X-MC-Ingress-Time: 1561667766645 Original-Received: from pdx1-sub0-mail-a2.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a2.g.dreamhost.com (Postfix) with ESMTP id 601F383DA9; Thu, 27 Jun 2019 13:36:02 -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=cZwL85tTbKnBy2ZGdvLzJFOmmXo=; b= Z85n98QwLNehbgc+ZN6cT1oGSoUtP5AwSYdp3xPCFXlQQV32el5kOt+kEk1N+56V ObxrdZEQLyINd9HoJ8ePa0yOcUpvSg4+k+ip/Jxgf58Mf4/PR0ACqJ8nyzGoM6da 8HFqlhgieEUgFgCzDHy8vBN7CarYz/TBdUMrUP21KRI= Original-Received: from mail.jurta.org (m91-129-109-60.cust.tele2.ee [91.129.109.60]) (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-a2.g.dreamhost.com (Postfix) with ESMTPSA id 0D74283DAA; Thu, 27 Jun 2019 13:35:58 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a2 In-Reply-To: <2cf332e4-b80e-43f1-82e5-7d1610f72362@default> (Drew Adams's message of "Thu, 27 Jun 2019 07:22:40 -0700 (PDT)") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrudekgdduheefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrdeitdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdelrdeitddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegurhgvfidrrggurghmshesohhrrggtlhgvrdgtohhmnecuvehluhhsthgvrhfuihiivgepud 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:161656 Archived-At: >> 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,