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: Tue, 25 Jun 2019 22:47:06 +0300 Organization: LINKOV.NET Message-ID: <87pnn11nm5.fsf@mail.linkov.net> References: <55AF90B9.5040401@gmail.com> <87si0jvkgv.fsf@gnus.org> 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="154463"; 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: 21112@debbugs.gnu.org, Raffaele Ricciardi To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 25 22:11:38 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 1hfrmz-000e2a-Tr for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Jun 2019 22:11:38 +0200 Original-Received: from localhost ([::1]:35024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfrmy-00043X-Uz for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Jun 2019 16:11:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51542) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfrmU-000426-0h for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 16:11:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfrmS-0001EY-7S for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 16:11:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48274) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfrmQ-0001Al-5R for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 16:11:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfrmP-0001fV-U1 for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 16:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jun 2019 20:11:01 +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.15614934556395 (code B ref 21112); Tue, 25 Jun 2019 20:11:01 +0000 Original-Received: (at 21112) by debbugs.gnu.org; 25 Jun 2019 20:10:55 +0000 Original-Received: from localhost ([127.0.0.1]:33584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfrmJ-0001f5-5m for submit@debbugs.gnu.org; Tue, 25 Jun 2019 16:10:55 -0400 Original-Received: from dog.birch.relay.mailchannels.net ([23.83.209.48]:49572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfrmG-0001ev-OV for 21112@debbugs.gnu.org; Tue, 25 Jun 2019 16:10:53 -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 B73EC140BC9; Tue, 25 Jun 2019 20:10:51 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a33.g.dreamhost.com (100-96-85-75.trex.outbound.svc.cluster.local [100.96.85.75]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 2978114188D; Tue, 25 Jun 2019 20:10:51 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a33.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); Tue, 25 Jun 2019 20:10:51 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Stretch-Snatch: 12d95bcc248f8de4_1561493451534_3140766806 X-MC-Loop-Signature: 1561493451534:3991316115 X-MC-Ingress-Time: 1561493451534 Original-Received: from pdx1-sub0-mail-a33.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a33.g.dreamhost.com (Postfix) with ESMTP id AAFBA80A4B; Tue, 25 Jun 2019 13:10:44 -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=tq9gu2WpCcms5DKN98Hep0SZS3k=; b= yWOr+DwQFqh1d4u/bypkIcL3FyIjmjkAhc5O+4NtRU96lY+XsS5QN3qwSgBRWdOs h2BF64sBQ/Ujpl9VoTNAYA+kd1Ep0BDievlhmzGKUlRGIOt0waJZfJr3dsGcX72Y SVlywm+K7M1Gr3hTHqWY2O23TiFqcsELSSHv3K5i3rc= 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-a33.g.dreamhost.com (Postfix) with ESMTPSA id F0B9480A58; Tue, 25 Jun 2019 13:10:41 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a33 In-Reply-To: (Lars Ingebrigtsen's message of "Tue, 25 Jun 2019 17:50:50 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrudeggddugeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrddvtdelnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledrvddtledprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehlrghrshhisehgnhhushdrohhrghenucevlhhushhtvghrufhiiigvpedt 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:161416 Archived-At: --=-=-= Content-Type: text/plain >>> (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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=minibuffer-message-properties.patch 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, --=-=-=--