unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: ndame <laszlomail@protonmail.com>,
	"Kévin Le Gouguec" <kevin.legouguec@gmail.com>,
	53255@debbugs.gnu.org
Subject: bug#53255: highlight-regexp should show faces with their properties applied when selecting a face
Date: Sat, 22 Jan 2022 20:51:54 +0200	[thread overview]
Message-ID: <86bl031u45.fsf@mail.linkov.net> (raw)
In-Reply-To: <875yqe1qxl.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 20 Jan 2022 14:23:50 +0100")

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

>> It shouldn't be limited to hi-lock.  It should be
>> for `read-face-name'.
>
> So I put the affixion thing into read-file-name and made hi-lock call
> read-file-name instead of doing the completion itself.

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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: read-face-name-defaults.patch --]
[-- Type: text/x-diff, Size: 1618 bytes --]

diff --git a/lisp/faces.el b/lisp/faces.el
index bb9b1e979f..7a1fae3669 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1065,7 +1065,7 @@ invert-face
 
 (defvar crm-separator) ; from crm.el
 
-(defun read-face-name (prompt &optional default multiple)
+(defun read-face-name (prompt &optional default multiple defaults)
   "Read one or more face names, prompting with PROMPT.
 PROMPT should not end in a space or a colon.
 
@@ -1129,7 +1129,7 @@ read-face-name
           (dolist (face (completing-read-multiple
                          prompt
                          (completion-table-in-turn nonaliasfaces aliasfaces)
-                         nil t nil 'face-name-history default))
+                         nil t nil 'face-name-history defaults))
             ;; Ignore elements that are not faces
             ;; (for example, because DEFAULT was "all faces")
             (if (facep face) (push (intern face) faces)))
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 8df73b1d37..a6760580f8 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -729,7 +729,8 @@ hi-lock-read-face-name
 	 face)
     (if (and hi-lock-auto-select-face (not current-prefix-arg))
 	(setq face (or (pop hi-lock--unused-faces) (car defaults)))
-      (setq face (symbol-name (read-face-name "Highlight using face" defaults)))
+      (setq face (symbol-name (read-face-name "Highlight using face"
+                                              (car defaults) t (cdr defaults))))
       ;; Update list of un-used faces.
       (setq hi-lock--unused-faces (remove face hi-lock--unused-faces))
       ;; Grow the list of defaults.

  parent reply	other threads:[~2022-01-22 18:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 13:37 bug#53255: highlight-regexp should show faces with their properties applied when selecting a face ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-15  8:46 ` Lars Ingebrigtsen
2022-01-15 10:05   ` Kévin Le Gouguec
2022-01-15 10:11     ` Lars Ingebrigtsen
2022-01-15 11:36       ` Kévin Le Gouguec
2022-01-15 19:14         ` Juri Linkov
2022-01-15 22:48         ` bug#53255: [External] : " Drew Adams
2022-01-20 13:23         ` Lars Ingebrigtsen
2022-01-20 22:58           ` Kévin Le Gouguec
2022-01-21  6:32             ` Kévin Le Gouguec
2022-01-21  9:30             ` Lars Ingebrigtsen
2022-01-21 13:39               ` Kévin Le Gouguec
2022-01-22 11:36                 ` Lars Ingebrigtsen
2022-01-21 17:06               ` bug#53255: [External] : " Drew Adams
2022-01-22 18:51           ` Juri Linkov [this message]
2022-01-23 12:38             ` Lars Ingebrigtsen
2022-01-23 18:45               ` Juri Linkov
2022-01-24  9:22                 ` Lars Ingebrigtsen
2022-01-15 22:40       ` bug#53255: [External] : " Drew Adams
2022-01-15 22:31     ` Drew Adams
2022-01-15 19:12   ` Juri Linkov
2022-01-16 18:20     ` Juri Linkov
2022-01-15 21:46   ` bug#53255: [External] : " 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=86bl031u45.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=53255@debbugs.gnu.org \
    --cc=kevin.legouguec@gmail.com \
    --cc=larsi@gnus.org \
    --cc=laszlomail@protonmail.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).