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


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> gmail.com>
To: 57003 <at> debbugs.gnu.org
Subject: bug#57003: 28.1.90; Can local variables be loaded before loading major mode?
Date: Fri, 05 Aug 2022 19:44:16 +0800
Hi,

Some user settings in Org mode need to be set before loading the major mode.
Further, some people want to set such settings in individual files using file-local variables.

However, Emacs loads file-local variables only _after_ major mode is being loaded.
As a result, we are getting user requests like https://list.orgmode.org/587be554-906c-5370-2cf2-f08b14fa58ff <at> gmail.com/T/#u

Currently, Elisp allows manual loading of file-local variables via `hack-local-variables'. However, this function itself is too forceful, and it is running, e.g. in non-file buffers. Moreover, calling `hack-local-variables' does not prevent its subsequent call after Org mode is loaded, which sometimes causes double unsafe variable prompts.
See https://list.orgmode.org/87r11wkmew.fsf <at> ucl.ac.uk/T/#mab6359ed2107d5515c6bb6b266551f0c5049ceca

Would it be possible in Emacs to implement a function or possibly major-mode option that will make Emacs load local variables before loading major mode, not after?

Best,
Ihor




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.