bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50944: malformed :safe entry in several defcustoms


From: Glenn Morris
Subject: bug#50944: malformed :safe entry in several defcustoms
Date: Sun, 03 Oct 2021 19:52:45 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Stefan Monnier wrote:

>> Around 30 defcustoms (mostly in Org) state ":safe t", which is incorrect.
>> The safe-local-variable property should be a predicate function of one
>> argument.
>
> The secondary bug here is that those errors should be flagged with
> a warning.

Run-time warning seems easy:

--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4042,7 +4042,7 @@ It is safe if any of these conditions are met:
    evaluates to a non-nil value with VAL as an argument."
   (or (member (cons sym val) safe-local-variable-values)
       (let ((safep (get sym 'safe-local-variable)))
-        (and (functionp safep)
+        (and safep
              ;; If the function signals an error, that means it
              ;; can't assure us that the value is safe.
              (with-demoted-errors (funcall safep val))))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]