GNU bug report logs - #29679
26.0.90; :after-hook not compiled

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Tue, 12 Dec 2017 20:08:01 UTC

Severity: normal

Found in version 26.0.90

Fixed in version 26.1

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: acm <at> muc.de, 29679 <at> debbugs.gnu.org
Subject: bug#29679: 26.0.90; :after-hook not compiled
Date: Fri, 15 Dec 2017 12:34:11 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Tue, 12 Dec 2017 15:07:24 -0500
> Cc: Alan Mackenzie <acm <at> muc.de>
> 
> I just realized that the :after-hook option of define-derived-mode (new
> in Emacs-26) is expanded in a way that introduces some problems.
> More specifically a
> 
>    :after-hook (foo bar)
> 
> gets turned into something like
> 
>    (push '(foo bar) 'delayed-after-hook-forms)
> 
> which means that the code (foo bar) is not byte-compiled, hence is not
> macro-expanded, and will be evaluated later via `eval` without paying
> attention to the setting of `lexical-binding`.
> 
> It's not a very serious problem in practice, but if we keep the code as
> we have it, it means that code byte-compiled with Emacs-26 will use the
> above
> 
>    (push '(foo bar) 'delayed-after-hook-forms)
> 
> in its .elc and we'll have to preserve backward compatibility with it.
> So it'd be better to fix it before Emacs-26 is released.
> Here's a minimal patch for it, which I hope is safe enough for emacs-26.
> 
> OK to push to emacs-26?

LGTM, thanks.  Alan, do you agree?




This bug report was last modified 7 years and 159 days ago.

Previous Next


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