unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat
       [not found] ` <20210301212448.4653D20E1B@vcs0.savannah.gnu.org>
@ 2021-03-02  0:02   ` Glenn Morris
  2021-03-02  5:57     ` Eli Zaretskii
  2021-03-02  6:51     ` Lars Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Glenn Morris @ 2021-03-02  0:02 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

Lars Ingebrigtsen wrote:

> branch: master
> commit e5392d38ac27c4cf1674997ab38a453877e65109

>     Make easymenu downcase the menu symbol for greater backwards compat

This may be more compatible for the goal of "replace old-style menu
definitions with easymenu ones", but it is an incompatible change for
any menus already defined with easymenu, which may be accessed by any
code outside of Emacs.

Eg term-mode-map used to contain "Signals", now it contains "signals".



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

* Re: master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat
  2021-03-02  0:02   ` master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat Glenn Morris
@ 2021-03-02  5:57     ` Eli Zaretskii
  2021-03-02  6:51     ` Lars Ingebrigtsen
  1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2021-03-02  5:57 UTC (permalink / raw)
  To: Glenn Morris; +Cc: larsi, emacs-devel

> From: Glenn Morris <rgm@gnu.org>
> Date: Mon, 01 Mar 2021 19:02:32 -0500
> Cc: Lars Ingebrigtsen <larsi@gnus.org>
> 
> Lars Ingebrigtsen wrote:
> 
> > branch: master
> > commit e5392d38ac27c4cf1674997ab38a453877e65109
> 
> >     Make easymenu downcase the menu symbol for greater backwards compat
> 
> This may be more compatible for the goal of "replace old-style menu
> definitions with easymenu ones", but it is an incompatible change for
> any menus already defined with easymenu, which may be accessed by any
> code outside of Emacs.
> 
> Eg term-mode-map used to contain "Signals", now it contains "signals".

What I had in mind was to teach lookup-key to look for both "Signals"
and "signals", perhaps first trying the literal match, then the
non-literal one.  And the same with "Create Empty file" vs
"create-empty-file".  Doing this in advance in easymenu is probably
going to cause more problems, indeed, especially as it can only handle
a single "normalized" symbol, whereas we may need to try several
alternatives to be less backward-incompatible.



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

* Re: master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat
  2021-03-02  0:02   ` master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat Glenn Morris
  2021-03-02  5:57     ` Eli Zaretskii
@ 2021-03-02  6:51     ` Lars Ingebrigtsen
  2021-03-02 13:56       ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-02  6:51 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

Glenn Morris <rgm@gnu.org> writes:

>>     Make easymenu downcase the menu symbol for greater backwards compat
>
> This may be more compatible for the goal of "replace old-style menu
> definitions with easymenu ones", but it is an incompatible change for
> any menus already defined with easymenu, which may be accessed by any
> code outside of Emacs.
>
> Eg term-mode-map used to contain "Signals", now it contains "signals".

Yup.  But I searched through both the Emacs tree and GNU ELPA and didn't
find a single instance of any upper-case menu `lookup-key' calls, so I
thought the likelihood of breakages was sufficiently small to make the
(incompatible) change.  But it should probably be called out in NEWS.

Changing `lookup-key' to accept both forms (like Eli) suggests in a
followup would be better, of course, if it can be done efficiently.

easymenu should also be extended with a form to allow explicitly
specifying the symbol to use: For instance, if you change the name of
the menu now, the symbol will also change.  So for backwards
compatibility, symbols should be specified when changing the name in
easymenu calls.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat
  2021-03-02  6:51     ` Lars Ingebrigtsen
@ 2021-03-02 13:56       ` Eli Zaretskii
  2021-03-03 14:36         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2021-03-02 13:56 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: rgm, emacs-devel

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Tue, 02 Mar 2021 07:51:12 +0100
> Cc: emacs-devel@gnu.org
> 
> Changing `lookup-key' to accept both forms (like Eli) suggests in a
> followup would be better, of course, if it can be done efficiently.

It should be as efficient as before for the case of a literal match;
it will be less efficient for a non-literal match or a mismatch.

> easymenu should also be extended with a form to allow explicitly
> specifying the symbol to use: For instance, if you change the name of
> the menu now, the symbol will also change.  So for backwards
> compatibility, symbols should be specified when changing the name in
> easymenu calls.

That'd be fine with me, but then (a) we should make sure the symbols
are in fact specified in all the uses of easymenu that replace
existing menus; and (b) would that still leave easymenu so much more
convenient to justify the switch?



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

* Re: master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat
  2021-03-02 13:56       ` Eli Zaretskii
@ 2021-03-03 14:36         ` Lars Ingebrigtsen
  2021-03-03 14:41           ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-03 14:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: rgm, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> easymenu should also be extended with a form to allow explicitly
>> specifying the symbol to use: For instance, if you change the name of
>> the menu now, the symbol will also change.  So for backwards
>> compatibility, symbols should be specified when changing the name in
>> easymenu calls.
>
> That'd be fine with me, but then (a) we should make sure the symbols
> are in fact specified in all the uses of easymenu that replace
> existing menus; and (b) would that still leave easymenu so much more
> convenient to justify the switch?

I was thinking of this :symbol keyword not as something we would use in
general, but in special cases where the symbol is known (or suspected to
be used) by other packages.  The more general case difference thing
should be handled more generally.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat
  2021-03-03 14:36         ` Lars Ingebrigtsen
@ 2021-03-03 14:41           ` Eli Zaretskii
  2021-03-03 18:46             ` Stefan Kangas
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2021-03-03 14:41 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: rgm, emacs-devel

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: rgm@gnu.org,  emacs-devel@gnu.org
> Date: Wed, 03 Mar 2021 15:36:23 +0100
> 
> > That'd be fine with me, but then (a) we should make sure the symbols
> > are in fact specified in all the uses of easymenu that replace
> > existing menus; and (b) would that still leave easymenu so much more
> > convenient to justify the switch?
> 
> I was thinking of this :symbol keyword not as something we would use in
> general, but in special cases where the symbol is known (or suspected to
> be used) by other packages.  The more general case difference thing
> should be handled more generally.

How can we know if a symbol is used?  There could be some 3rd party
package out there using it which we didn't hear about.



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

* Re: master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat
  2021-03-03 14:41           ` Eli Zaretskii
@ 2021-03-03 18:46             ` Stefan Kangas
  2021-03-03 19:20               ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2021-03-03 18:46 UTC (permalink / raw)
  To: Eli Zaretskii, Lars Ingebrigtsen; +Cc: rgm, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> I was thinking of this :symbol keyword not as something we would use in
>> general, but in special cases where the symbol is known (or suspected to
>> be used) by other packages.  The more general case difference thing
>> should be handled more generally.
>
> How can we know if a symbol is used?  There could be some 3rd party
> package out there using it which we didn't hear about.

We should be able to get a fairly good estimate by checking our own
sources, GNU ELPA, and code search on GitHub.

If we want to take it to the next level one could download all of MELPA
and check there too.  (If someone has a one-liner or a short script to
download all packages and keep them updated, I'm personally all ears.)



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

* Re: master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat
  2021-03-03 18:46             ` Stefan Kangas
@ 2021-03-03 19:20               ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2021-03-03 19:20 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: rgm, larsi, emacs-devel

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Wed, 3 Mar 2021 12:46:39 -0600
> Cc: rgm@gnu.org, emacs-devel@gnu.org
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> I was thinking of this :symbol keyword not as something we would use in
> >> general, but in special cases where the symbol is known (or suspected to
> >> be used) by other packages.  The more general case difference thing
> >> should be handled more generally.
> >
> > How can we know if a symbol is used?  There could be some 3rd party
> > package out there using it which we didn't hear about.
> 
> We should be able to get a fairly good estimate by checking our own
> sources, GNU ELPA, and code search on GitHub.
> 
> If we want to take it to the next level one could download all of MELPA
> and check there too.  (If someone has a one-liner or a short script to
> download all packages and keep them updated, I'm personally all ears.)

It should be much easier to just always add :symbol, IMO.



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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210301212446.5364.12431@vcs0.savannah.gnu.org>
     [not found] ` <20210301212448.4653D20E1B@vcs0.savannah.gnu.org>
2021-03-02  0:02   ` master e5392d3: Make easymenu downcase the menu symbol for greater backwards compat Glenn Morris
2021-03-02  5:57     ` Eli Zaretskii
2021-03-02  6:51     ` Lars Ingebrigtsen
2021-03-02 13:56       ` Eli Zaretskii
2021-03-03 14:36         ` Lars Ingebrigtsen
2021-03-03 14:41           ` Eli Zaretskii
2021-03-03 18:46             ` Stefan Kangas
2021-03-03 19:20               ` 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).