Subject: bug#47198: [External] : Re: bug#47198: 27.1; Why bind some commands by default if they're not defined?

From: Drew Adams <[email-masked]>
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?