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.

Full log


View this message in rfc822 format

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: bug#47198: [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?




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.