GNU bug report logs -
#76687
global-hi-lock-mode prompts on its own help
Previous Next
To reply to this bug, email your comments to 76687 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Sun, 02 Mar 2025 15:50:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Daniel Colascione <dancol <at> dancol.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 02 Mar 2025 15:50:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From emacs -Q, M-x global-hi-lock-mode, then C-h m, then quit the help
buffer, and type C-h m again. You'll get prompted about whether you
want to apply the hi-lock patterns in the help buffer. And then,
because for some reason we don't actually clear the help buffer but just
narrow it to what we want, the next time you ask for help, even on
something unrelated to hi-lock (e.g. progn), hi-lock will ask you
whether you want to apply hi-lock patterns.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Sun, 02 Mar 2025 16:34:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 76687 <at> debbugs.gnu.org (full text, mbox):
> From: Daniel Colascione <dancol <at> dancol.org>
> Date: Sun, 02 Mar 2025 10:49:15 -0500
>
> >From emacs -Q, M-x global-hi-lock-mode, then C-h m, then quit the help
> buffer, and type C-h m again. You'll get prompted about whether you
> want to apply the hi-lock patterns in the help buffer. And then,
> because for some reason we don't actually clear the help buffer but just
> narrow it to what we want, the next time you ask for help, even on
> something unrelated to hi-lock (e.g. progn), hi-lock will ask you
> whether you want to apply hi-lock patterns.
That's the default of hi-lock-file-patterns-policy, no? IIUC, hi-lock
asks this question for every file you visit, if it finds the patterns
there.
Or what am I missing?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Sun, 02 Mar 2025 17:22:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 76687 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Daniel Colascione <dancol <at> dancol.org>
>> Date: Sun, 02 Mar 2025 10:49:15 -0500
>>
>> >From emacs -Q, M-x global-hi-lock-mode, then C-h m, then quit the help
>> buffer, and type C-h m again. You'll get prompted about whether you
>> want to apply the hi-lock patterns in the help buffer. And then,
>> because for some reason we don't actually clear the help buffer but just
>> narrow it to what we want, the next time you ask for help, even on
>> something unrelated to hi-lock (e.g. progn), hi-lock will ask you
>> whether you want to apply hi-lock patterns.
>
> That's the default of hi-lock-file-patterns-policy, no? IIUC, hi-lock
> asks this question for every file you visit, if it finds the patterns
> there.
>
> Or what am I missing?
Hi-lock is asking to apply patterns in the help buffer because it's
matching its own example patterns, not patterns any user meant to
actually apply.
When hi-lock is started and if the mode is not excluded or patterns
rejected, the beginning of the buffer is searched for lines of the
form:
Hi-lock: (FOO ...)
It's not helpful to prompt the user in this case, especially not for
help invocations unrelated to hi-lock.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Sun, 02 Mar 2025 17:25:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 76687 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Daniel Colascione <dancol <at> dancol.org>
>> Date: Sun, 02 Mar 2025 10:49:15 -0500
>>
>> >From emacs -Q, M-x global-hi-lock-mode, then C-h m, then quit the help
>> buffer, and type C-h m again. You'll get prompted about whether you
>> want to apply the hi-lock patterns in the help buffer. And then,
>> because for some reason we don't actually clear the help buffer but just
>> narrow it to what we want, the next time you ask for help, even on
>> something unrelated to hi-lock (e.g. progn), hi-lock will ask you
>> whether you want to apply hi-lock patterns.
>
> That's the default of hi-lock-file-patterns-policy, no? IIUC, hi-lock
> asks this question for every file you visit, if it finds the patterns
> there.
>
> Or what am I missing?
The default is `ask`, which is documented to mean:
If `ask', prompt when patterns found in buffer; if bound to a
function,
but `(describe-function 'progn)` doesn't describe any patterns.
(FWIW, I'm very much not a fan of this default. If the user didn't want
them highlighted, she would not have turned on `global-hi-lock-mode`.)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Sun, 02 Mar 2025 17:33:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 76687 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefankangas <at> gmail.com> writes:
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Daniel Colascione <dancol <at> dancol.org>
>>> Date: Sun, 02 Mar 2025 10:49:15 -0500
>>>
>>> >From emacs -Q, M-x global-hi-lock-mode, then C-h m, then quit the help
>>> buffer, and type C-h m again. You'll get prompted about whether you
>>> want to apply the hi-lock patterns in the help buffer. And then,
>>> because for some reason we don't actually clear the help buffer but just
>>> narrow it to what we want, the next time you ask for help, even on
>>> something unrelated to hi-lock (e.g. progn), hi-lock will ask you
>>> whether you want to apply hi-lock patterns.
>>
>> That's the default of hi-lock-file-patterns-policy, no? IIUC, hi-lock
>> asks this question for every file you visit, if it finds the patterns
>> there.
>>
>> Or what am I missing?
>
> The default is `ask`, which is documented to mean:
>
> If `ask', prompt when patterns found in buffer; if bound to a
> function,
>
> but `(describe-function 'progn)` doesn't describe any patterns.
>
> (FWIW, I'm very much not a fan of this default. If the user didn't want
> them highlighted, she would not have turned on `global-hi-lock-mode`.)
Isn't the idea that hi-lock patterns can contain arbitrary font lock
keywords which can run arbitrary code?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Sun, 02 Mar 2025 18:57:03 GMT)
Full text and
rfc822 format available.
Message #20 received at 76687 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Perhaps as simple as adding help modes to hi-lock-exclude-modes? It looks
like hi-lock mode exclusion logic might need a little improvement to honor
derived modes.
On Sun, Mar 2, 2025 at 12:33 PM Daniel Colascione <dancol <at> dancol.org> wrote:
> Stefan Kangas <stefankangas <at> gmail.com> writes:
>
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> >
> >>> From: Daniel Colascione <dancol <at> dancol.org>
> >>> Date: Sun, 02 Mar 2025 10:49:15 -0500
> >>>
> >>> >From emacs -Q, M-x global-hi-lock-mode, then C-h m, then quit the help
> >>> buffer, and type C-h m again. You'll get prompted about whether you
> >>> want to apply the hi-lock patterns in the help buffer. And then,
> >>> because for some reason we don't actually clear the help buffer but
> just
> >>> narrow it to what we want, the next time you ask for help, even on
> >>> something unrelated to hi-lock (e.g. progn), hi-lock will ask you
> >>> whether you want to apply hi-lock patterns.
> >>
> >> That's the default of hi-lock-file-patterns-policy, no? IIUC, hi-lock
> >> asks this question for every file you visit, if it finds the patterns
> >> there.
> >>
> >> Or what am I missing?
> >
> > The default is `ask`, which is documented to mean:
> >
> > If `ask', prompt when patterns found in buffer; if bound to a
> > function,
> >
> > but `(describe-function 'progn)` doesn't describe any patterns.
> >
> > (FWIW, I'm very much not a fan of this default. If the user didn't want
> > them highlighted, she would not have turned on `global-hi-lock-mode`.)
>
> Isn't the idea that hi-lock patterns can contain arbitrary font lock
> keywords which can run arbitrary code?
>
>
>
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Mon, 03 Mar 2025 12:51:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 76687 <at> debbugs.gnu.org (full text, mbox):
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sun, 2 Mar 2025 13:56:37 -0500
> Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 76687 <at> debbugs.gnu.org
>
> Perhaps as simple as adding help modes to hi-lock-exclude-modes? It looks like hi-lock mode exclusion
> logic might need a little improvement to honor derived modes.
Any reason why Help mode should be exempt from global-hi-lock-mode?
This bug report shows a single instance of that mode which perhaps
needs to be fixed, so why disable the mode for all of the Help
buffers?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Mon, 03 Mar 2025 13:11:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 76687 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Daniel can put help modes into the exclude list if this solves his problem,
even if imperfect.
On Mon, Mar 3, 2025 at 7:50 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > From: Ship Mints <shipmints <at> gmail.com>
> > Date: Sun, 2 Mar 2025 13:56:37 -0500
> > Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
> 76687 <at> debbugs.gnu.org
> >
> > Perhaps as simple as adding help modes to hi-lock-exclude-modes? It
> looks like hi-lock mode exclusion
> > logic might need a little improvement to honor derived modes.
>
> Any reason why Help mode should be exempt from global-hi-lock-mode?
> This bug report shows a single instance of that mode which perhaps
> needs to be fixed, so why disable the mode for all of the Help
> buffers?
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Mon, 03 Mar 2025 13:40:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 76687 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Ship Mints <shipmints <at> gmail.com>
>> Date: Sun, 2 Mar 2025 13:56:37 -0500
>> Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 76687 <at> debbugs.gnu.org
>>
>> Perhaps as simple as adding help modes to hi-lock-exclude-modes? It looks like hi-lock mode exclusion
>> logic might need a little improvement to honor derived modes.
>
> Any reason why Help mode should be exempt from global-hi-lock-mode?
> This bug report shows a single instance of that mode which perhaps
> needs to be fixed, so why disable the mode for all of the Help
> buffers?
First, isn't the bug here that you get a prompt despite there being no
Hi-lock lines? Why would you prompt in that case?
Second, and orthogonally, perhaps special-mode should be in
hi-lock-exclude modes by default.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Mon, 03 Mar 2025 14:29:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 76687 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Mon, 3 Mar 2025 13:39:38 +0000
> Cc: dancol <at> dancol.org, 76687 <at> debbugs.gnu.org
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> From: Ship Mints <shipmints <at> gmail.com>
> >> Date: Sun, 2 Mar 2025 13:56:37 -0500
> >> Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 76687 <at> debbugs.gnu.org
> >>
> >> Perhaps as simple as adding help modes to hi-lock-exclude-modes? It looks like hi-lock mode exclusion
> >> logic might need a little improvement to honor derived modes.
> >
> > Any reason why Help mode should be exempt from global-hi-lock-mode?
> > This bug report shows a single instance of that mode which perhaps
> > needs to be fixed, so why disable the mode for all of the Help
> > buffers?
>
> First, isn't the bug here that you get a prompt despite there being no
> Hi-lock lines? Why would you prompt in that case?
I understood that there _are_ Hi-lock lines in that buffer.
> Second, and orthogonally, perhaps special-mode should be in
> hi-lock-exclude modes by default.
Again, I find no reasons to exclude special-mode. People may wish to
highlight a regexp everywhere.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Mon, 03 Mar 2025 14:56:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 76687 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Stefan Kangas <stefankangas <at> gmail.com>
>> Date: Mon, 3 Mar 2025 13:39:38 +0000
>> Cc: dancol <at> dancol.org, 76687 <at> debbugs.gnu.org
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> >> From: Ship Mints <shipmints <at> gmail.com>
>> >> Date: Sun, 2 Mar 2025 13:56:37 -0500
>> >> Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 76687 <at> debbugs.gnu.org
>> >>
>> >> Perhaps as simple as adding help modes to hi-lock-exclude-modes? It looks like hi-lock mode exclusion
>> >> logic might need a little improvement to honor derived modes.
>> >
>> > Any reason why Help mode should be exempt from global-hi-lock-mode?
>> > This bug report shows a single instance of that mode which perhaps
>> > needs to be fixed, so why disable the mode for all of the Help
>> > buffers?
>>
>> First, isn't the bug here that you get a prompt despite there being no
>> Hi-lock lines? Why would you prompt in that case?
>
> I understood that there _are_ Hi-lock lines in that buffer.
Right, so more precisely there are two bugs:
1. We incorrectly treat the examples from the hi-lock-mode docstring as
highlighting patterns in the *Help* buffer.
2. We incorrectly consider the examples from the hi-lock-mode docstring,
when looking at _other_ docstrings, after having looked at that one.
I think adding help-mode to `hi-lock-exclude` would solve both bugs,
however see below.
>> Second, and orthogonally, perhaps special-mode should be in
>> hi-lock-exclude modes by default.
>
> Again, I find no reasons to exclude special-mode. People may wish to
> highlight a regexp everywhere.
That's true. The issue is that `hi-lock-exclude-modes' disables all
highlighting, even when manually added. That is undesirable, I agree.
This suggests that we need a more fine-grained control that disables
only the "Hi-lock:" pattern handling (i.e. only the unsafe part).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76687
; Package
emacs
.
(Mon, 03 Mar 2025 15:39:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 76687 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Mon, 3 Mar 2025 06:54:56 -0800
> Cc: shipmints <at> gmail.com, dancol <at> dancol.org, 76687 <at> debbugs.gnu.org
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Again, I find no reasons to exclude special-mode. People may wish to
> > highlight a regexp everywhere.
>
> That's true. The issue is that `hi-lock-exclude-modes' disables all
> highlighting, even when manually added. That is undesirable, I agree.
>
> This suggests that we need a more fine-grained control that disables
> only the "Hi-lock:" pattern handling (i.e. only the unsafe part).
Yes, and only in a *Help* buffer that shows this hi-lock variable
itself. Maybe we should format the example in some very special way
or something like that.
This bug report was last modified 103 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.