unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47198: 27.1; Why bind some commands by default if they're not defined?
@ 2021-03-16 17:57 Drew Adams
  2021-03-16 18:40 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2021-03-16 17:57 UTC (permalink / raw)
  To: 47198

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)






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#47198: 27.1; Why bind some commands by default if they're not defined?
  2021-03-16 17:57 bug#47198: 27.1; Why bind some commands by default if they're not defined? Drew Adams
@ 2021-03-16 18:40 ` Eli Zaretskii
  2021-03-16 19:35   ` bug#47198: [External] : " Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-03-16 18:40 UTC (permalink / raw)
  To: Drew Adams; +Cc: 47198

> From: Drew Adams <drew.adams@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?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#47198: [External] : Re: bug#47198: 27.1; Why bind some commands by default if they're not defined?
  2021-03-16 18:40 ` Eli Zaretskii
@ 2021-03-16 19:35   ` Drew Adams
  2021-03-16 19:42     ` Eli Zaretskii
  2021-03-16 19:46     ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Drew Adams @ 2021-03-16 19:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 47198@debbugs.gnu.org

> >  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?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#47198: [External] : Re: bug#47198: 27.1; Why bind some commands by default if they're not defined?
  2021-03-16 19:35   ` bug#47198: [External] : " Drew Adams
@ 2021-03-16 19:42     ` Eli Zaretskii
  2021-03-16 19:46     ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2021-03-16 19:42 UTC (permalink / raw)
  To: Drew Adams; +Cc: 47198

> From: Drew Adams <drew.adams@oracle.com>
> CC: "47198@debbugs.gnu.org" <47198@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#47198: [External] : Re: bug#47198: 27.1; Why bind some commands by default if they're not defined?
  2021-03-16 19:35   ` bug#47198: [External] : " Drew Adams
  2021-03-16 19:42     ` Eli Zaretskii
@ 2021-03-16 19:46     ` Eli Zaretskii
  2021-03-16 19:48       ` Drew Adams
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-03-16 19:46 UTC (permalink / raw)
  To: Drew Adams; +Cc: 47198-done

> From: Drew Adams <drew.adams@oracle.com>
> CC: "47198@debbugs.gnu.org" <47198@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#47198: [External] : Re: bug#47198: 27.1; Why bind some commands by default if they're not defined?
  2021-03-16 19:46     ` Eli Zaretskii
@ 2021-03-16 19:48       ` Drew Adams
  2021-03-16 20:12         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2021-03-16 19:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 47198-done@debbugs.gnu.org

> > > >  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?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#47198: [External] : Re: bug#47198: 27.1; Why bind some commands by default if they're not defined?
  2021-03-16 19:48       ` Drew Adams
@ 2021-03-16 20:12         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2021-03-16 20:12 UTC (permalink / raw)
  To: Drew Adams; +Cc: 47198

> From: Drew Adams <drew.adams@oracle.com>
> CC: "47198-done@debbugs.gnu.org" <47198-done@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-16 20:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-16 17:57 bug#47198: 27.1; Why bind some commands by default if they're not defined? Drew Adams
2021-03-16 18:40 ` Eli Zaretskii
2021-03-16 19:35   ` bug#47198: [External] : " Drew Adams
2021-03-16 19:42     ` Eli Zaretskii
2021-03-16 19:46     ` Eli Zaretskii
2021-03-16 19:48       ` Drew Adams
2021-03-16 20:12         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).