From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#53255: highlight-regexp should show faces with their properties applied when selecting a face Date: Sun, 23 Jan 2022 20:45:07 +0200 Organization: LINKOV.NET Message-ID: <86pmois34c.fsf@mail.linkov.net> References: <87y23hl729.fsf@gnus.org> <87zgnxnwkf.fsf@gmail.com> <877db1wboq.fsf@gnus.org> <87v8ylnsc1.fsf@gmail.com> <875yqe1qxl.fsf@gnus.org> <86bl031u45.fsf@mail.linkov.net> <87sfte8w4z.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26046"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: ndame , =?UTF-8?Q?K=C3=A9vin?= Le Gouguec , 53255@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 23 19:51:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nBhxI-0006eB-71 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Jan 2022 19:51:12 +0100 Original-Received: from localhost ([::1]:47702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBhxC-0006cx-R9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Jan 2022 13:51:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBhtH-0006bT-Ax for bug-gnu-emacs@gnu.org; Sun, 23 Jan 2022 13:47:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nBhtG-00028i-6T for bug-gnu-emacs@gnu.org; Sun, 23 Jan 2022 13:47:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nBhtG-0004am-5f for bug-gnu-emacs@gnu.org; Sun, 23 Jan 2022 13:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jan 2022 18:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53255 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 53255-submit@debbugs.gnu.org id=B53255.164296357717591 (code B ref 53255); Sun, 23 Jan 2022 18:47:02 +0000 Original-Received: (at 53255) by debbugs.gnu.org; 23 Jan 2022 18:46:17 +0000 Original-Received: from localhost ([127.0.0.1]:41275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBhsW-0004Ze-Mq for submit@debbugs.gnu.org; Sun, 23 Jan 2022 13:46:16 -0500 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:43863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBhsU-0004ZN-0M for 53255@debbugs.gnu.org; Sun, 23 Jan 2022 13:46:14 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 657F3240005; Sun, 23 Jan 2022 18:46:04 +0000 (UTC) In-Reply-To: <87sfte8w4z.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 23 Jan 2022 13:38:36 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:224962 Archived-At: --=-=-= Content-Type: text/plain >> This has such regression that before it supported the following workflow: >> in the minibuffer 'M-n M-n ...' used to pull hi-lock faces from the ordered >> "future history" list. But read-face-name doesn't support this feature. >> >> If highlight-regexp should use read-face-name, then this feature >> could be added to read-face-name. Here is the simplest patch, >> but it would be a tough task to explain the need of an additional >> DEFAULTS arg in the documentation. An alternative would be to >> rewrite read-face-name and keep cdr of the existing arg DEFAULT >> for the future history of the minibuffer. > > Hm, I assumed that that was what read-face-name did (since it allows > DEFAULT to be a list). Then read-face-name should be improved to support a list of defaults: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=read-face-name-defaults.patch diff --git a/lisp/faces.el b/lisp/faces.el index bb9b1e979f..c03a0ff8c1 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1081,6 +1081,7 @@ read-face-name element of DEFAULT is returned. If DEFAULT isn't a list, but MULTIPLE is non-nil, a one-element list containing DEFAULT is returned. Otherwise, DEFAULT is returned verbatim." + (let (defaults) (unless (listp default) (setq default (list default))) (when default @@ -1090,7 +1091,7 @@ read-face-name default ", ") ;; If we only want one, and the default is more than one, ;; discard the unwanted ones. - (setq default (car default)) + (setq defaults default default (car default)) (if (symbolp default) (symbol-name default) default)))) @@ -1137,8 +1138,8 @@ read-face-name (let ((face (completing-read prompt (completion-table-in-turn nonaliasfaces aliasfaces) - nil t nil 'face-name-history default))) - (if (facep face) (intern face)))))) + nil t nil 'face-name-history defaults))) + (if (facep face) (intern face))))))) ;; Not defined without X, but behind window-system test. (defvar x-bitmap-file-path) --=-=-=--