GNU bug report logs - #54240
emacs/lisp/emacs-lisp/derived.el patch

Previous Next

Package: emacs;

Reported by: chenphy10 <at> gmail.com

Date: Thu, 3 Mar 2022 17:10:02 UTC

Severity: normal

Tags: moreinfo

Fixed in version 28.1

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 54240 <at> debbugs.gnu.org, chenphy10 <at> gmail.com
Subject: bug#54240: emacs/lisp/emacs-lisp/derived.el patch
Date: Fri, 04 Mar 2022 22:39:32 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Oh, yeah -- I was thinking that the mode had to be lexically bound
> there, but of course it isn't really, since eval is ... eval.  (Whenever
> there's an eval in code, there's a bug somewhere.)

`defvar' doesn't eval the first argument, and there is no alternative to
using it (right?).  So `derived-mode-init-mode-variables' should just
better be a macro I think.

> Would adding LEXICAL to the eval form fix the issue here, or would that
> interact oddly with the defvar?

Yes - since `defvar' doesn't evaluate its first argument no variable
references will work.  The constructed sexp must contain the final
symbol at that position, any other expression won't do it.

Michael.




This bug report was last modified 3 years and 77 days ago.

Previous Next


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