unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kira Bruneau via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 56957@debbugs.gnu.org
Subject: bug#56957: [PATCH] Fix ignored-local-variable-values for non-primitive values
Date: Wed, 03 Aug 2022 18:09:50 +0000	[thread overview]
Message-ID: <9RWG0AQeAiQorgDI765IlZT2f_67aE7wMa0PPZRiNSZmMIOI_Hvz6fer6Ph4HvujTNd4mv2aoqXHryzvKX_pcpgu7itrz5tdNdDdoUGarY8=@pm.me> (raw)

[-- Attachment #1: Type: text/plain, Size: 154 bytes --]

I noticed that structural comparison wasn't being done to ignore values in `ignored-local-variable-values', so it could only ever ignore primitive values.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-ignored-local-variable-values-for-non-primitive-.patch --]
[-- Type: text/x-patch; name=0001-Fix-ignored-local-variable-values-for-non-primitive-.patch, Size: 1283 bytes --]

From 6ae9a9ee9a177da9fbbc3e31faf0202fb846aebb Mon Sep 17 00:00:00 2001
From: Kira Bruneau <kira.bruneau@gmail.com>
Date: Wed, 3 Aug 2022 13:47:47 -0400
Subject: [PATCH] Fix ignored-local-variable-values for non-primitive values

This was previously using seq-some + eq to compare against ignored
values, but now we use member to structurally compare values like we
do for `safe-local-variable-values'.
* lisp/files.el (hack-local-variables-filter): Fix
`ignored-local-variable-values' for non-primitive values.
---
 lisp/files.el | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 5df1966193..215e7db7d8 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3848,10 +3848,7 @@ DIR-NAME is the name of the associated directory.  Otherwise it is nil."
 	(cond ((memq var ignored-local-variables)
 	       ;; Ignore any variable in `ignored-local-variables'.
 	       nil)
-              ((seq-some (lambda (elem)
-                           (and (eq (car elem) var)
-                                (eq (cdr elem) val)))
-                         ignored-local-variable-values)
+              ((member elt ignored-local-variable-values)
                nil)
 	      ;; Obey `enable-local-eval'.
 	      ((eq var 'eval)
-- 
2.37.1


             reply	other threads:[~2022-08-03 18:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03 18:09 Kira Bruneau via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-08-03 18:17 ` bug#56957: [PATCH] Fix ignored-local-variable-values for non-primitive values Kira Bruneau via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-04  6:26   ` 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='9RWG0AQeAiQorgDI765IlZT2f_67aE7wMa0PPZRiNSZmMIOI_Hvz6fer6Ph4HvujTNd4mv2aoqXHryzvKX_pcpgu7itrz5tdNdDdoUGarY8=@pm.me' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=56957@debbugs.gnu.org \
    --cc=kira.bruneau@pm.me \
    /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).