GNU bug report logs - #51056
29.0.50; Making `gnus-define-keys' obsolete

Previous Next

Package: emacs;

Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>

Date: Wed, 6 Oct 2021 10:15:02 UTC

Severity: normal

Merged with 51070

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51056 in the body.
You can then email your comments to 51056 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51056; Package emacs. (Wed, 06 Oct 2021 10:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars Ingebrigtsen <larsi <at> gnus.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 06 Oct 2021 10:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: bug-gnu-emacs <at> gnu.org
Cc: Stephen Gildea <stepheng+emacs <at> gildea.com>
Subject: 29.0.50; Making `gnus-define-keys' obsolete
Date: Wed, 06 Oct 2021 12:14:13 +0200
Emacs 29 has grown a new function to define keymaps, `define-keymap'
somewhat inspired by the more than two-decades-old macro
`gnus-define-keys'.

So I've now replaced all the usages of `gnus-define-keys' in Emacs 29
with `define-keymap' and was about to make `gnus-define-keys' obsolete,
but that macro is used by mh-e, too.  mh-e is also distributed outside
Emacs, if I understand correctly, so this code can't be converted.

Stephen, would it make sense to copy the Gnus macro into mh-e, and
rename it mh-define-keys?  That way `gnus-define-keys' could be
obsoleted.

A different solution would be to write a new mh-define-keymap that more
closely mimics the new `define-keymap' function, and then use it instead
in mh-e -- that's probably a better long-term solution, because you
could then remove the mh-define-keymap function at some later date (when
you shift the mh-e target to Emacs 29+).


In GNU Emacs 29.0.50 (build 36, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-10-06 built on elva
Repository revision: 8e37466efc36dab153a9c784ce1ff41c5a663318
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)


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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51056; Package emacs. (Wed, 06 Oct 2021 14:02:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephen Gildea <stepheng+emacs <at> gildea.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: bug-gnu-emacs <at> gnu.org, mh-e-devel <at> lists.sourceforge.net
Subject: Re: 29.0.50; Making `gnus-define-keys' obsolete
Date: Wed, 06 Oct 2021 07:01:29 -0700
+mh-e-devel

Lars Ingebrigtsen <larsi <at> gnus.org> wrote to me:

>   Emacs 29 has grown a new function to define keymaps, `define-keymap'
>   somewhat inspired by the more than two-decades-old macro
>   `gnus-define-keys'.
>   
>   So I've now replaced all the usages of `gnus-define-keys' in Emacs 29
>   with `define-keymap' and was about to make `gnus-define-keys' obsolete,
>   but that macro is used by mh-e, too.  mh-e is also distributed outside
>   Emacs, if I understand correctly, so this code can't be converted.
>   
>   Stephen, would it make sense to copy the Gnus macro into mh-e, and
>   rename it mh-define-keys?  That way `gnus-define-keys' could be
>   obsoleted.
>   
>   A different solution would be to write a new mh-define-keymap that more
>   closely mimics the new `define-keymap' function, and then use it instead
>   in mh-e -- that's probably a better long-term solution, because you
>   could then remove the mh-define-keymap function at some later date (when
>   you shift the mh-e target to Emacs 29+).

MH-E is no longer developed nor distributed separately from GNU Emacs,
since maybe 2015.

You can update the MH-E part of the Emacs source tree to use Emacs 29
features.  No compatibility is needed.

Thanks for checking,

 < Stephen




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51056; Package emacs. (Wed, 06 Oct 2021 21:10:02 GMT) Full text and rfc822 format available.

Message #11 received at 51056 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Stephen Gildea <stepheng+emacs <at> gildea.com>
Cc: 51056 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 mh-e-devel <at> lists.sourceforge.net
Subject: Re: bug#51056: 29.0.50; Making `gnus-define-keys' obsolete
Date: Wed, 6 Oct 2021 17:09:11 -0400
Stephen Gildea <stepheng+emacs <at> gildea.com> writes:

> MH-E is no longer developed nor distributed separately from GNU Emacs,
> since maybe 2015.

Does that mean that the XEmacs compatibility code in MH-E could also be
removed?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51056; Package emacs. (Thu, 07 Oct 2021 02:49:01 GMT) Full text and rfc822 format available.

Message #14 received at 51056 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Gildea <stepheng+emacs <at> gildea.com>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 51056 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 mh-e-devel <at> lists.sourceforge.net
Subject: Re: bug#51056: 29.0.50; Making `gnus-define-keys' obsolete
Date: Wed, 06 Oct 2021 19:48:08 -0700
Stefan Kangas <stefan <at> marxist.se> wrote:

>   Stephen Gildea <stepheng+emacs <at> gildea.com> writes:
>   
>   > MH-E is no longer developed nor distributed separately from GNU Emacs,
>   > since maybe 2015.
>   
>   Does that mean that the XEmacs compatibility code in MH-E could also be
>   removed?

Yes.




Forcibly Merged 51056 51070. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 07 Oct 2021 07:52:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51056; Package emacs. (Thu, 07 Oct 2021 16:48:02 GMT) Full text and rfc822 format available.

Message #19 received at 51056 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stephen Gildea <stepheng+emacs <at> gildea.com>
Cc: 51056 <at> debbugs.gnu.org, mh-e-devel <at> lists.sourceforge.net
Subject: Re: bug#51056: 29.0.50; Making `gnus-define-keys' obsolete
Date: Thu, 07 Oct 2021 18:46:53 +0200
Stephen Gildea <stepheng+emacs <at> gildea.com> writes:

> You can update the MH-E part of the Emacs source tree to use Emacs 29
> features.  No compatibility is needed.

I've now converted the calls and done some extremely light testing, but
I don't see any obvious breakages (but I don't have mh set up properly
on my system).  Can you check whether I broke anything?

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




bug Marked as fixed in versions 29.1. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 07 Oct 2021 16:51:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51056; Package emacs. (Mon, 11 Oct 2021 19:01:01 GMT) Full text and rfc822 format available.

Message #24 received at 51056 <at> debbugs.gnu.org (full text, mbox):

From: Bill Wohler <wohler <at> newt.com>
To: Stephen Gildea <stepheng+emacs <at> gildea.com>
Cc: 51056 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Stefan Kangas <stefan <at> marxist.se>, mh-e-devel <at> lists.sourceforge.net
Subject: Re: bug#51056: 29.0.50; Making `gnus-define-keys' obsolete
Date: Mon, 11 Oct 2021 12:00:12 -0700
Stephen Gildea <stepheng+emacs <at> gildea.com> wrote:

> Stefan Kangas <stefan <at> marxist.se> wrote:
> 
> >   Stephen Gildea <stepheng+emacs <at> gildea.com> writes:
> >   
> >   > MH-E is no longer developed nor distributed separately from GNU Emacs,
> >   > since maybe 2015.
> >   
> >   Does that mean that the XEmacs compatibility code in MH-E could also be
> >   removed?
> 
> Yes.

Stefan and Lars,

Thanks so much for the MH-E clean-ups! They are very much appreciated.
So far, I haven't noticed any issues with your updates.

-- 
Bill Wohler <wohler <at> newt.com> aka <Bill.Wohler <at> nasa.gov>
http://www.newt.com/wohler/, GnuPG ID:610BD9AD




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51056; Package emacs. (Mon, 11 Oct 2021 19:47:01 GMT) Full text and rfc822 format available.

Message #27 received at 51056 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Bill Wohler <wohler <at> newt.com>, Stephen Gildea <stepheng+emacs <at> gildea.com>
Cc: 51056 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 mh-e-devel <at> lists.sourceforge.net
Subject: Re: bug#51056: 29.0.50; Making `gnus-define-keys' obsolete
Date: Mon, 11 Oct 2021 12:46:41 -0700
Bill Wohler <wohler <at> newt.com> writes:

> Thanks so much for the MH-E clean-ups! They are very much appreciated.
> So far, I haven't noticed any issues with your updates.

Thank you, that is an encouraging report.

If we do break something, we can always back those commits out for
further investigation, as I already had to do in one case.  The culprit
was this change, but I can't say that I understand why:

diff --git a/lisp/mh-e/mh-tool-bar.el b/lisp/mh-e/mh-tool-bar.el
index 805408cfc7..7cc0a1e83c 100644
--- a/lisp/mh-e/mh-tool-bar.el
+++ b/lisp/mh-e/mh-tool-bar.el
@@ -27,8 +27,7 @@
 ;;; Code:

 (require 'mh-e)
-(mh-do-in-gnu-emacs
-  (require 'tool-bar))
+(require 'tool-bar)

 ;;; Tool Bar Commands

So this innocent looking change leads to this:

In mh-tool-bar-define:
mh-e/mh-tool-bar.el:180:62: Warning: reference to free variable ‘folder-docs’
mh-e/mh-tool-bar.el:222:36: Warning: reference to free variable
    ‘folder-button-setter’
mh-e/mh-tool-bar.el:226:36: Warning: reference to free variable
    ‘sequence-button-setter’
mh-e/mh-tool-bar.el:191:34: Warning: reference to free variable ‘show-buttons’
mh-e/mh-tool-bar.el:230:36: Warning: reference to free variable
    ‘show-button-setter’
mh-e/mh-tool-bar.el:234:36: Warning: reference to free variable
    ‘show-seq-button-setter’
mh-e/mh-tool-bar.el:295:41: Warning: reference to free variable
    ‘letter-buttons’
mh-e/mh-tool-bar.el:296:41: Warning: reference to free variable ‘letter-docs’
mh-e/mh-tool-bar.el:245:36: Warning: reference to free variable
    ‘letter-button-setter’
mh-e/mh-tool-bar.el:280:51: Warning: reference to free variable
    ‘folder-defaults’
mh-e/mh-tool-bar.el:291:51: Warning: reference to free variable
    ‘letter-defaults’
mh-e/mh-tool-bar.el:194:36: Warning: reference to free variable
    ‘folder-vectors’
mh-e/mh-tool-bar.el:195:11: Warning: reference to free variable ‘show-vectors’
mh-e/mh-tool-bar.el:196:11: Warning: reference to free variable
    ‘letter-vectors’
mh-e/mh-tool-bar.el:197:14: Warning: assignment to free variable
    ‘folder-defaults’
mh-e/mh-tool-bar.el:199:61: Warning: assignment to free variable
    ‘letter-defaults’
mh-e/mh-tool-bar.el:189:11: Warning: reference to free variable
    ‘folder-buttons’
mh-e/mh-tool-bar.el:189:36: Warning: assignment to free variable
    ‘folder-buttons’
mh-e/mh-tool-bar.el:189:36: Warning: assignment to free variable
    ‘letter-buttons’
mh-e/mh-tool-bar.el:189:36: Warning: assignment to free variable
    ‘show-buttons’
mh-e/mh-tool-bar.el:189:36: Warning: assignment to free variable ‘letter-docs’
mh-e/mh-tool-bar.el:285:41: Warning: assignment to free variable ‘folder-docs’
mh-e/mh-tool-bar.el:285:41: Warning: assignment to free variable
    ‘folder-vectors’
mh-e/mh-tool-bar.el:285:41: Warning: assignment to free variable
    ‘show-vectors’
mh-e/mh-tool-bar.el:285:41: Warning: assignment to free variable
    ‘letter-vectors’
mh-e/mh-tool-bar.el:301:1: Error: Symbol’s value as variable is void:
folder-docs
  ELC      mh-e/mh-xface.elc
make[2]: *** [Makefile:316: mh-e/mh-tool-bar.elc] Error 1

Any ideas here are welcome.




bug marked as fixed in version 29.1, send any further explanations to 51056 <at> debbugs.gnu.org and Lars Ingebrigtsen <larsi <at> gnus.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 12 Oct 2021 10:41:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51056; Package emacs. (Tue, 12 Oct 2021 10:44:01 GMT) Full text and rfc822 format available.

Message #32 received at 51056 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 51056 <at> debbugs.gnu.org, Stephen Gildea <stepheng+emacs <at> gildea.com>,
 Bill Wohler <wohler <at> newt.com>, mh-e-devel <at> lists.sourceforge.net
Subject: Re: bug#51056: 29.0.50; Making `gnus-define-keys' obsolete
Date: Tue, 12 Oct 2021 12:43:43 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> If we do break something, we can always back those commits out for
> further investigation, as I already had to do in one case.  The culprit
> was this change, but I can't say that I understand why:

[...]

> -(mh-do-in-gnu-emacs
> -  (require 'tool-bar))

It's because mh-do-in-gnu-emacs is autoloaded and pulls in mh-acros,
while mh-dlet* isn't autoloaded, and we're not requiring mh-acros, so it
fails if you remove that macro.

I think the solution is just to require mh-acros (or possibly autoload
mh-dlet*).  (The latter can probably just be rewritten to use dlet,
though.)

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51056; Package emacs. (Tue, 12 Oct 2021 11:45:01 GMT) Full text and rfc822 format available.

Message #35 received at 51056 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 51056 <at> debbugs.gnu.org, Stephen Gildea <stepheng+emacs <at> gildea.com>,
 Bill Wohler <wohler <at> newt.com>, mh-e-devel <at> lists.sourceforge.net
Subject: Re: bug#51056: 29.0.50; Making `gnus-define-keys' obsolete
Date: Tue, 12 Oct 2021 04:44:38 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I think the solution is just to require mh-acros (or possibly autoload
> mh-dlet*).  (The latter can probably just be rewritten to use dlet,
> though.)

Aha!  Thanks, now fixed on master.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 09 Nov 2021 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.