unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tom Gillespie <tgbugs@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: [PATCH] Fix evaluation order for hack-local-variables
Date: Wed, 12 May 2021 14:25:08 -0700	[thread overview]
Message-ID: <CA+G3_PMCg+5RzooiSvNN_fGfB29Po-9j6iH4cJBw5e3KTonEHQ@mail.gmail.com> (raw)

[-- 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


             reply	other threads:[~2021-05-12 21:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 21:25 Tom Gillespie [this message]
2021-05-12 21:32 ` [PATCH] Fix evaluation order for hack-local-variables Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+G3_PMCg+5RzooiSvNN_fGfB29Po-9j6iH4cJBw5e3KTonEHQ@mail.gmail.com \
    --to=tgbugs@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).