GNU bug report logs - #47198
27.1; Why bind some commands by default if they're not defined?

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Tue, 16 Mar 2021 17:58:02 UTC

Severity: minor

Found in version 27.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47198 in the body.
You can then email your comments to 47198 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47198; Package emacs. (Tue, 16 Mar 2021 17:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 16 Mar 2021 17:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 27.1; Why bind some commands by default if they're not defined?
Date: Tue, 16 Mar 2021 17:57:45 +0000
emacs -Q
C-h b

There is this entry, with no link on the command name:

 M-s h f		hi-lock-find-patterns

This is apparently because file `bindings.el' adds the key binding:

  (define-key search-map "hf"   'hi-lock-find-patterns)

Is it a good idea that we do this even though the command is not yet
defined?

Seems like such a binding should be in hi-lock.el, and be created only
after the command is created, no?

(This bug is a bit similar to #47197, I guess.  But `vc-ignore' doesn't
seem to be bound anywhere.)


In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)
 of 2020-08-12 built on CIRROCUMULUS
Repository revision: 86d8d76aa36037184db0b2897c434cdaab1a9ae8
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.19041
System Description: Microsoft Windows 10 Pro (v10.0.2004.19041.804)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47198; Package emacs. (Tue, 16 Mar 2021 18:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 47198 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 47198 <at> debbugs.gnu.org
Subject: Re: bug#47198: 27.1;
 Why bind some commands by default if they're not defined?
Date: Tue, 16 Mar 2021 20:40:13 +0200
> From: Drew Adams <drew.adams <at> oracle.com>
> Date: Tue, 16 Mar 2021 17:57:45 +0000
> 
>  M-s h f		hi-lock-find-patterns
> 
> This is apparently because file `bindings.el' adds the key binding:
> 
>   (define-key search-map "hf"   'hi-lock-find-patterns)
> 
> Is it a good idea that we do this even though the command is not yet
> defined?
> 
> Seems like such a binding should be in hi-lock.el, and be created only
> after the command is created, no?

If the command is in hi-lock.el, how do you cause hi-lock to autoload
when first invoked?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47198; Package emacs. (Tue, 16 Mar 2021 19:36:01 GMT) Full text and rfc822 format available.

Message #11 received at 47198 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "47198 <at> debbugs.gnu.org" <47198 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#47198: 27.1; Why bind some commands by
 default if they're not defined?
Date: Tue, 16 Mar 2021 19:35:39 +0000
> >  M-s h f		hi-lock-find-patterns
> >
> > This is apparently because file `bindings.el' adds the key binding:
> >
> >   (define-key search-map "hf"   'hi-lock-find-patterns)
> >
> > Is it a good idea that we do this even though the
> > command is not yet defined?
> >
> > Seems like such a binding should be in hi-lock.el,
> > and be created only after the command is created, no?
> 
> If the command is in hi-lock.el, how do you cause hi-lock
> to autoload when first invoked?

I didn't say anything about autoloading anything.

`search-map' will always be defined in Emacs.
`hi-lock.el' can itself create that binding.

But yes, autoloading based on the command isn't
the same thing as binding a key that will, by
invoking the (undefined) command, cause its
definition to be loaded.

Feel free to fix this some other way.

We're binding a key to a command that doesn't
(yet) exist.

Is it important that that key be available at
the outset as a way to autoload that library?

At least in my use, I see only that command and
`vc-ignore' that are listed in `C-h b' but without
the commands having links.

What's so special about them?  Put differently,
how have we succeeded in solving the same problem
for other commands in files not loaded by default?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47198; Package emacs. (Tue, 16 Mar 2021 19:43:01 GMT) Full text and rfc822 format available.

Message #14 received at 47198 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 47198 <at> debbugs.gnu.org
Subject: Re: [External] : Re: bug#47198: 27.1; Why bind some commands by
 default if they're not defined?
Date: Tue, 16 Mar 2021 21:42:14 +0200
> From: Drew Adams <drew.adams <at> oracle.com>
> CC: "47198 <at> debbugs.gnu.org" <47198 <at> debbugs.gnu.org>
> Date: Tue, 16 Mar 2021 19:35:39 +0000
> 
> Feel free to fix this some other way.

I see nothing here that needs fixing because it's broken, certainly
not badly enough to risk unintended consequences (which are always
around the corner when trying to fix such femto-problems).  So I think
this bug report should be closed as wontfix.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Tue, 16 Mar 2021 19:47:01 GMT) Full text and rfc822 format available.

Notification sent to Drew Adams <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Tue, 16 Mar 2021 19:47:02 GMT) Full text and rfc822 format available.

Message #19 received at 47198-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 47198-done <at> debbugs.gnu.org
Subject: Re: [External] : Re: bug#47198: 27.1; Why bind some commands by
 default if they're not defined?
Date: Tue, 16 Mar 2021 21:46:27 +0200
> From: Drew Adams <drew.adams <at> oracle.com>
> CC: "47198 <at> debbugs.gnu.org" <47198 <at> debbugs.gnu.org>
> Date: Tue, 16 Mar 2021 19:35:39 +0000
> 
> > >  M-s h f		hi-lock-find-patterns
> > >
> > > This is apparently because file `bindings.el' adds the key binding:

Btw, this command does have a link in the pretest of Emacs 27.2.

So I'm closing this bug report.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47198; Package emacs. (Tue, 16 Mar 2021 19:49:01 GMT) Full text and rfc822 format available.

Message #22 received at 47198-done <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "47198-done <at> debbugs.gnu.org" <47198-done <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#47198: 27.1; Why bind some commands by
 default if they're not defined?
Date: Tue, 16 Mar 2021 19:48:46 +0000
> > > >  M-s h f		hi-lock-find-patterns
> > > >
> > > > This is apparently because file `bindings.el' adds the key binding:
> 
> Btw, this command does have a link in the pretest of Emacs 27.2.
> So I'm closing this bug report.

Great.  Thanks for closing it.

What was the solution that took care of this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47198; Package emacs. (Tue, 16 Mar 2021 20:13:01 GMT) Full text and rfc822 format available.

Message #25 received at 47198 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 47198 <at> debbugs.gnu.org
Subject: Re: [External] : Re: bug#47198: 27.1; Why bind some commands by
 default if they're not defined?
Date: Tue, 16 Mar 2021 22:12:05 +0200
> From: Drew Adams <drew.adams <at> oracle.com>
> CC: "47198-done <at> debbugs.gnu.org" <47198-done <at> debbugs.gnu.org>
> Date: Tue, 16 Mar 2021 19:48:46 +0000
> 
> What was the solution that took care of this?

I have no idea.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 14 Apr 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.