GNU bug report logs - #50944
malformed :safe entry in several defcustoms

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Fri, 1 Oct 2021 15:43:02 UTC

Severity: normal

Found in version 28.0.60

Fixed in version 28.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 50944 <at> debbugs.gnu.org
Subject: bug#50944: malformed :safe entry in several defcustoms
Date: Sun, 03 Oct 2021 19:52:45 -0400
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))))))




This bug report was last modified 3 years and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.