unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Yikes!  easy-menu-add is suddenly compiled to `ignore', without any warning.
@ 2021-04-07  9:29 Alan Mackenzie
  2021-04-07 10:06 ` Stefan Kangas
  2021-04-07 11:41 ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Alan Mackenzie @ 2021-04-07  9:29 UTC (permalink / raw)
  To: emacs-devel, Stefan Kangas

Hello, Emacs and Stefan K.

In Emacs 28, easy-menu-add is now compiled to `ignore'.  This isn't
friendly, particularly as in Emacs 27.2 and earlier, it just worked,
without any warnings of impending obsoletion.

The warning message Emacs 28.1 gives out is particularly unfriendly and
unhelpful.  It looks like this:

    cc-mode.el:2591:4: Warning: `easy-menu-add' is an obsolete function
    (as of 28.1); use `ignore' instead.

Use `ignore' instead?

Why have we not followed the normal procedure here, by marking the
function as obsolete, yet leaving it working, for one or two major
versions, and only then removing it?

This sudden removal of easy-menu-add will cause unnecessary annoyance
amongst maintainers whose sources still use it.  Even in the Emacs
sources there are 25 uses of the function.

The commit which created this situation was probably this one:

commit affe9b225de711429248a73f920dc9f38b15c932
Author: Stefan Kangas <stefan@marxist.se>
Date:   Tue Nov 24 17:39:11 2020 +0100

    Make XEmacs compat aliases easy-menu-{add,remove} obsolete

-- 
Alan Mackenzie (Nuremberg, Germany).



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

* Re: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning.
  2021-04-07  9:29 Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning Alan Mackenzie
@ 2021-04-07 10:06 ` Stefan Kangas
  2021-04-07 11:24   ` Ulrich Mueller
  2021-04-07 11:58   ` Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning Alan Mackenzie
  2021-04-07 11:41 ` Eli Zaretskii
  1 sibling, 2 replies; 11+ messages in thread
From: Stefan Kangas @ 2021-04-07 10:06 UTC (permalink / raw)
  To: Alan Mackenzie, emacs-devel

Alan Mackenzie <acm@muc.de> writes:

> In Emacs 28, easy-menu-add is now compiled to `ignore'.  This isn't
> friendly, particularly as in Emacs 27.2 and earlier, it just worked,
> without any warnings of impending obsoletion.

What does "working" mean here?  In Emacs 27.1, I have here:

    easy-menu-add is an alias for ‘ignore’ in ‘easymenu.el’.

> Why have we not followed the normal procedure here, by marking the
> function as obsolete, yet leaving it working, for one or two major
> versions, and only then removing it?

It is my understanding that this has followed the normal procedure for
obsoletion.

> This sudden removal of easy-menu-add will cause unnecessary annoyance
> amongst maintainers whose sources still use it.  Even in the Emacs
> sources there are 25 uses of the function.

This function is only relevant in XEmacs, so if this is important to you
I recommend changing any such call to say:

  (when (featurep 'xemacs)
    (easy-menu-add foo-menu))

The Emacs sources should already be updated accordingly.

> The warning message Emacs 28.1 gives out is particularly unfriendly and
> unhelpful.  It looks like this:
>
>     cc-mode.el:2591:4: Warning: `easy-menu-add' is an obsolete function
>     (as of 28.1); use `ignore' instead.

Yes, we could improve that message.

Perhaps it could say:  "it is not needed, so just remove it"



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

* Re: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning.
  2021-04-07 10:06 ` Stefan Kangas
@ 2021-04-07 11:24   ` Ulrich Mueller
  2021-04-07 11:37     ` Eli Zaretskii
  2021-04-07 14:30     ` XEmacs compatibility (was: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning) Stefan Monnier
  2021-04-07 11:58   ` Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning Alan Mackenzie
  1 sibling, 2 replies; 11+ messages in thread
From: Ulrich Mueller @ 2021-04-07 11:24 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Alan Mackenzie, emacs-devel

>>>>> On Wed, 07 Apr 2021, Stefan Kangas wrote:

> This function is only relevant in XEmacs, so if this is important to
> you I recommend changing any such call to say:

>   (when (featurep 'xemacs)
>     (easy-menu-add foo-menu))

Why can't it be left in place, though? An alias for "ignore" is cheap
and requires zero maintenance.

OTOH, removing it will make the life of those people who try to keep
their packages compatible with XEmacs more complicated.



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

* Re: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning.
  2021-04-07 11:24   ` Ulrich Mueller
@ 2021-04-07 11:37     ` Eli Zaretskii
  2021-04-07 14:14       ` Ulrich Mueller
  2021-04-07 14:30     ` XEmacs compatibility (was: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning) Stefan Monnier
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2021-04-07 11:37 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: acm, stefan, emacs-devel

> From: Ulrich Mueller <ulm@gentoo.org>
> Date: Wed, 07 Apr 2021 13:24:57 +0200
> Cc: Alan Mackenzie <acm@muc.de>, emacs-devel@gnu.org
> 
> >>>>> On Wed, 07 Apr 2021, Stefan Kangas wrote:
> 
> > This function is only relevant in XEmacs, so if this is important to
> > you I recommend changing any such call to say:
> 
> >   (when (featurep 'xemacs)
> >     (easy-menu-add foo-menu))
> 
> Why can't it be left in place, though? An alias for "ignore" is cheap
> and requires zero maintenance.

"Zero maintenance" is an exaggeration, IME.  Not every code fragment
that uses these compatibility shims is as clear-cut as the snippet
above; more often than not, when working on code which references
those shims, one needs to dig quite deeply into the sources until
he/she understands that the code is a no-op in Emacs.  That digging
takes/wastes time and effort.

> OTOH, removing it will make the life of those people who try to keep
> their packages compatible with XEmacs more complicated.

I'm sorry, but that ship has sailed several months ago.  Gobs of
XEmacs compatibility features were removed already, after the removal
move was announced.  Are you saying we should reinstate all of them
back?  If not, what is so special about this particular one?



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

* Re: Yikes!  easy-menu-add is suddenly compiled to `ignore', without any warning.
  2021-04-07  9:29 Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning Alan Mackenzie
  2021-04-07 10:06 ` Stefan Kangas
@ 2021-04-07 11:41 ` Eli Zaretskii
  2021-04-07 12:32   ` Alan Mackenzie
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2021-04-07 11:41 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: stefan, emacs-devel

> Date: Wed, 7 Apr 2021 09:29:38 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
> Hello, Emacs and Stefan K.
> 
> In Emacs 28, easy-menu-add is now compiled to `ignore'.  This isn't
> friendly, particularly as in Emacs 27.2 and earlier, it just worked,
> without any warnings of impending obsoletion.
> 
> The warning message Emacs 28.1 gives out is particularly unfriendly and
> unhelpful.  It looks like this:
> 
>     cc-mode.el:2591:4: Warning: `easy-menu-add' is an obsolete function
>     (as of 28.1); use `ignore' instead.
> 
> Use `ignore' instead?

easy-menu-add was an alias of 'ignore' since 4 years ago.  How come
it is suddenly an issue what it is compiled to?  Are you sure the
issue isn't the obsolescence warning itself? that was indeed added
last November.

> Why have we not followed the normal procedure here, by marking the
> function as obsolete, yet leaving it working, for one or two major
> versions, and only then removing it?

It wasn't removed, so the procedure followed here is indeed our usual
one.



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

* Re: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning.
  2021-04-07 10:06 ` Stefan Kangas
  2021-04-07 11:24   ` Ulrich Mueller
@ 2021-04-07 11:58   ` Alan Mackenzie
  2021-04-07 12:43     ` Stefan Kangas
  1 sibling, 1 reply; 11+ messages in thread
From: Alan Mackenzie @ 2021-04-07 11:58 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: emacs-devel

Hello, Stefan.

First of all, sorry for being so strident in my opening post.  I now
understand what's happening.

On Wed, Apr 07, 2021 at 05:06:04 -0500, Stefan Kangas wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > In Emacs 28, easy-menu-add is now compiled to `ignore'.  This isn't
> > friendly, particularly as in Emacs 27.2 and earlier, it just worked,
> > without any warnings of impending obsoletion.

> What does "working" mean here?

No "threatening" warning message.  The message I got from that warning
message was that it would be necessary to replace easy-menu-add by some
other working code, which the message didn't specify.

> In Emacs 27.1, I have here:

>     easy-menu-add is an alias for ‘ignore’ in ‘easymenu.el’.

> > Why have we not followed the normal procedure here, by marking the
> > function as obsolete, yet leaving it working, for one or two major
> > versions, and only then removing it?

> It is my understanding that this has followed the normal procedure for
> obsoletion.

OK, I got confused.  I might not be the only one.

> > This sudden removal of easy-menu-add will cause unnecessary annoyance
> > amongst maintainers whose sources still use it.  Even in the Emacs
> > sources there are 25 uses of the function.

I think I might be right about that point.

> This function is only relevant in XEmacs, so if this is important to you
> I recommend changing any such call to say:

>   (when (featurep 'xemacs)
>     (easy-menu-add foo-menu))

> The Emacs sources should already be updated accordingly.

Yes.  I'd missed out the -B1 flag in my grep call.  :-(

> > The warning message Emacs 28.1 gives out is particularly unfriendly and
> > unhelpful.  It looks like this:

> >     cc-mode.el:2591:4: Warning: `easy-menu-add' is an obsolete function
> >     (as of 28.1); use `ignore' instead.

> Yes, we could improve that message.

> Perhaps it could say:  "it is not needed, so just remove it".

Maybe it could say something like "which was always a no-op in Emacs",
thus reassuring maintainers that they needn't worry about lost menu
functionality.

-- 
Alan Mackenzie (Nuremberg, Germany).



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

* Re: Yikes!  easy-menu-add is suddenly compiled to `ignore', without any warning.
  2021-04-07 11:41 ` Eli Zaretskii
@ 2021-04-07 12:32   ` Alan Mackenzie
  0 siblings, 0 replies; 11+ messages in thread
From: Alan Mackenzie @ 2021-04-07 12:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: stefan, emacs-devel

Hello, Eli.

On Wed, Apr 07, 2021 at 14:41:01 +0300, Eli Zaretskii wrote:
> > Date: Wed, 7 Apr 2021 09:29:38 +0000
> > From: Alan Mackenzie <acm@muc.de>

> > Hello, Emacs and Stefan K.

> > In Emacs 28, easy-menu-add is now compiled to `ignore'.  This isn't
> > friendly, particularly as in Emacs 27.2 and earlier, it just worked,
> > without any warnings of impending obsoletion.

> > The warning message Emacs 28.1 gives out is particularly unfriendly and
> > unhelpful.  It looks like this:

> >     cc-mode.el:2591:4: Warning: `easy-menu-add' is an obsolete function
> >     (as of 28.1); use `ignore' instead.

> > Use `ignore' instead?

> easy-menu-add was an alias of 'ignore' since 4 years ago.  How come
> it is suddenly an issue what it is compiled to?  Are you sure the
> issue isn't the obsolescence warning itself? that was indeed added
> last November.

The issue is indeed the warning message, from which I got the impression
that menu functionality had been removed.  The message appeared to be
telling me not to bother about this apparent loss in functionality.

It's a strange thing indeed to suggest using `ignore' in source code,
except for certain specific reasons.  Suggesting total removal of
easy-menu-add, if there is a way of doing that, would be better.

> > Why have we not followed the normal procedure here, by marking the
> > function as obsolete, yet leaving it working, for one or two major
> > versions, and only then removing it?

> It wasn't removed, so the procedure followed here is indeed our usual
> one.

OK.  The warning message was confusing, at least for me.

-- 
Alan Mackenzie (Nuremberg, Germany).



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

* Re: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning.
  2021-04-07 11:58   ` Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning Alan Mackenzie
@ 2021-04-07 12:43     ` Stefan Kangas
  0 siblings, 0 replies; 11+ messages in thread
From: Stefan Kangas @ 2021-04-07 12:43 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: emacs-devel

Hi Alan,

Alan Mackenzie <acm@muc.de> writes:

> First of all, sorry for being so strident in my opening post.  I now
> understand what's happening.

No worries, I'm just happy we could clarify the situation.  I think this
is just an example of the kind of confusion that these compatibility
shims can sometimes cause.

>> > The warning message Emacs 28.1 gives out is particularly unfriendly and
>> > unhelpful.  It looks like this:
>
>> >     cc-mode.el:2591:4: Warning: `easy-menu-add' is an obsolete function
>> >     (as of 28.1); use `ignore' instead.
>
>> Yes, we could improve that message.
>
>> Perhaps it could say:  "it is not needed, so just remove it".
>
> Maybe it could say something like "which was always a no-op in Emacs",
> thus reassuring maintainers that they needn't worry about lost menu
> functionality.

I have now done this on master (commit 43984d72b0).  Feel free to tweak
the message if you see a way to make it even more clear.



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

* Re: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning.
  2021-04-07 11:37     ` Eli Zaretskii
@ 2021-04-07 14:14       ` Ulrich Mueller
  2021-04-07 14:24         ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Ulrich Mueller @ 2021-04-07 14:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: acm, stefan, emacs-devel

>>>>> On Wed, 07 Apr 2021, Eli Zaretskii wrote:

> I'm sorry, but that ship has sailed several months ago.  Gobs of
> XEmacs compatibility features were removed already, after the removal
> move was announced.  Are you saying we should reinstate all of them
> back?  If not, what is so special about this particular one?

I'm not asking for any such thing. It's just an observation that keeping
a package working for both Emacs and XEmacs requires adding more and
more conditional code because of a diverging API.

Some changes I find difficult to understand. There seems little
incentive for removing trivial one-line aliases like easy-menu-add,
unless the goal were to intentionally break compatibility.



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

* Re: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning.
  2021-04-07 14:14       ` Ulrich Mueller
@ 2021-04-07 14:24         ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2021-04-07 14:24 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: acm, stefan, emacs-devel

> From: Ulrich Mueller <ulm@gentoo.org>
> Cc: acm@muc.de,  stefan@marxist.se,  emacs-devel@gnu.org
> Date: Wed, 07 Apr 2021 16:14:01 +0200
> 
> There seems little incentive for removing trivial one-line aliases
> like easy-menu-add, unless the goal were to intentionally break
> compatibility.

Once again, easy-menu-add was NOT (yet) removed.  It was declared
obsolete, in preparation for removal in some distant future.



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

* XEmacs compatibility (was: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning)
  2021-04-07 11:24   ` Ulrich Mueller
  2021-04-07 11:37     ` Eli Zaretskii
@ 2021-04-07 14:30     ` Stefan Monnier
  1 sibling, 0 replies; 11+ messages in thread
From: Stefan Monnier @ 2021-04-07 14:30 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: Alan Mackenzie, Stefan Kangas, emacs-devel

> OTOH, removing it will make the life of those people who try to keep
> their packages compatible with XEmacs more complicated.

This breed is critically endangered, and for me the sooner it goes
extinct the better, because they make the life of the rest of us
more complicated.

AFAIK in the current Emacs and GNU ELPA code there are only 2 packages
left which care about XEmacs compatibility: CC-mode and verilog-mode
(both of which try to maintain compatibility with Emacs-21 as well,
which makes sense, since XEmacs hasn't seen very much development since
the days of Emacs-21, so the two featuresets have more or less the same
age).


        Stefan




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

end of thread, other threads:[~2021-04-07 14:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  9:29 Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning Alan Mackenzie
2021-04-07 10:06 ` Stefan Kangas
2021-04-07 11:24   ` Ulrich Mueller
2021-04-07 11:37     ` Eli Zaretskii
2021-04-07 14:14       ` Ulrich Mueller
2021-04-07 14:24         ` Eli Zaretskii
2021-04-07 14:30     ` XEmacs compatibility (was: Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning) Stefan Monnier
2021-04-07 11:58   ` Yikes! easy-menu-add is suddenly compiled to `ignore', without any warning Alan Mackenzie
2021-04-07 12:43     ` Stefan Kangas
2021-04-07 11:41 ` Eli Zaretskii
2021-04-07 12:32   ` Alan Mackenzie

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).