From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: ndame <laszlomail@protonmail.com>, 53255@debbugs.gnu.org
Subject: bug#53255: highlight-regexp should show faces with their properties applied when selecting a face
Date: Thu, 20 Jan 2022 23:58:43 +0100 [thread overview]
Message-ID: <87lezadnfg.fsf@gmail.com> (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: 1424 bytes --]
Lars Ingebrigtsen <larsi@gnus.org> writes:
> So I put the affixion thing into read-file-name and made hi-lock call
> read-file-name instead of doing the completion itself.
Great! A couple of nits:
1. Is there a reason why you went with (list "SAMPLE\t" "" face) instead
of (list face "" \tSAMPLE)? "(elisp) Completion Variables" says that
the completion goes first, then the prefix, then the suffix; I don't
know how hard a rule that is, however I do think the latter option
fares better when faced with variable heights.
Cf. patch and screenshots: I like the second option better because
IIUC the face names (which is what I'll be focusing my eyes on in
order to know what to type; the face decoration I can see well enough
in my peripheral vision) stand a better chance of being aligned.
(Although I don't know if it's the hour getting late or something,
but now that I actually try out C-u M-s h r I just… can't get any
highlighting, with or without my patch on top. The completion works
fine, but when I exit the minibuffer… nothing gets highlighted.
Ugh. Will sleep on it)
2. As you can see on the screenshots, the prompt shows the default face
twice. I think fixing this is as simple as removing format-prompt
(patch also attached), but then again, I'm not thinking straight this
evening it seems.
Thanks for your time.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: affixation.patch --]
[-- Type: text/x-patch, Size: 632 bytes --]
diff --git a/lisp/faces.el b/lisp/faces.el
index bb9b1e979f..cd6145cf68 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1112,10 +1112,10 @@ read-face-name
(lambda (faces)
(mapcar
(lambda (face)
- (list (concat (propertize "SAMPLE" 'face face)
- "\t")
+ (list face
""
- face))
+ (concat "\t"
+ (propertize "SAMPLE" 'face face))))
faces))))
aliasfaces nonaliasfaces faces)
;; Build up the completion tables.
[-- Attachment #3: current.png --]
[-- Type: image/png, Size: 99434 bytes --]
[-- Attachment #4: suggested.png --]
[-- Type: image/png, Size: 99488 bytes --]
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: defaults.patch --]
[-- Type: text/x-patch, Size: 688 bytes --]
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 53e6f779b3..c748bdebfb 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -730,9 +730,7 @@ hi-lock-read-face-name
(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
- (format-prompt "Highlight using face" (car defaults))
- defaults)))
+ (read-face-name "Highlight using face" defaults)))
;; Update list of un-used faces.
(setq hi-lock--unused-faces (remove face hi-lock--unused-faces))
;; Grow the list of defaults.
next prev parent reply other threads:[~2022-01-20 22:58 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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lezadnfg.fsf@gmail.com \
--to=kevin.legouguec@gmail.com \
--cc=53255@debbugs.gnu.org \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.