* [PATCH] Fix evaluation order for hack-local-variables
@ 2021-05-12 21:25 Tom Gillespie
2021-05-12 21:32 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Tom Gillespie @ 2021-05-12 21:25 UTC (permalink / raw)
To: Emacs developers
[-- Attachment #1: Type: text/plain, Size: 184 bytes --]
Hi,
Here is a patch to restore the correct order of evaluation for
local variables following an unintended change introduced in
5bedbe6b1d5f4b801abf91b4d023d5c4e66418f0. Best!
Tom
[-- Attachment #2: 0001-Fix-evaluation-order-for-hack-local-variables.patch --]
[-- Type: text/x-patch, Size: 1358 bytes --]
From bd23461b6151af07f2981b5e4fb97dae1e03beb1 Mon Sep 17 00:00:00 2001
From: Tom Gillespie <tgbugs@gmail.com>
Date: Wed, 12 May 2021 14:15:36 -0700
Subject: [PATCH] Fix evaluation order for hack-local-variables
* lisp/files.el (hack-local-variables): Fix the ordering which
local variables are evaluated by `hack-local-variables' so that
prop-line local variables are evaluated first. There is a hidden
nreverse lurking in `hack-local-variables-apply' which means that
the prop line variables must come second in order to be evaluated
before the end of file variables.
---
lisp/files.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/files.el b/lisp/files.el
index 47c5fc133c..60f72660f3 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3771,8 +3771,8 @@ hack-local-variables
(with-demoted-errors "Directory-local variables error: %s"
;; Note this is a no-op if enable-local-variables is nil.
(hack-dir-local-variables))
- (let ((result (append (hack-local-variables-prop-line)
- (hack-local-variables--find-variables))))
+ (let ((result (append (hack-local-variables--find-variables)
+ (hack-local-variables-prop-line))))
(if (and enable-local-variables
(not (inhibit-local-variables-p)))
(progn
--
2.26.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix evaluation order for hack-local-variables
2021-05-12 21:25 [PATCH] Fix evaluation order for hack-local-variables Tom Gillespie
@ 2021-05-12 21:32 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-12 21:32 UTC (permalink / raw)
To: Tom Gillespie; +Cc: Emacs developers
Tom Gillespie <tgbugs@gmail.com> writes:
> Here is a patch to restore the correct order of evaluation for
> local variables following an unintended change introduced in
> 5bedbe6b1d5f4b801abf91b4d023d5c4e66418f0. Best!
Nice catch! Applied to Emacs 28.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-12 21:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-12 21:25 [PATCH] Fix evaluation order for hack-local-variables Tom Gillespie
2021-05-12 21:32 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.