GNU bug report logs - #57003
28.1.90; Can local variables be loaded before loading major mode?

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> gmail.com>

Date: Fri, 5 Aug 2022 11:44:02 UTC

Severity: wishlist

Found in version 28.1.90

Full log


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

From: Ihor Radchenko <yantar92 <at> gmail.com>
To: rms <at> gnu.org
Cc: larsi <at> gnus.org, 57003 <at> debbugs.gnu.org
Subject: Re: bug#57003: 28.1.90; Can local variables be loaded before
 loading major mode?
Date: Wed, 31 Aug 2022 11:29:08 +0800
Richard Stallman <rms <at> gnu.org> writes:

> That's the right thing to do.  However, your previous message seemed
> to imply a problem, because it proposed loading these buffer-local
> variables "before executing the major mode body", and that would be
> before `kill-all-local-variables'.  That function would kill these new
> bindings, unless it were prevented from doing so.

I was referring to define-derived-mode macro, where
`kill-all-local-variables' is actually called before BODY argument. Of
course, as Lars pointed, some major modes may not use
`define-derived-mode' and the meaning of "body" is different.

The major modes that do not use define-derived-mode are actually
problematic. While we can expect `kill-all-local-variables' to be called
early even in such major modes, the mode symbol is not yet known by the
time `kill-all-local-variables' is called. I am not sure how to approach
the proposed 'early-local property for mode-specific
file/directory-local variables in such scenario.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92




This bug report was last modified 1 year and 288 days ago.

Previous Next


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