unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50944: malformed :safe entry in several defcustoms
@ 2021-10-01 15:41 Glenn Morris
  2021-10-02 20:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2021-10-01 15:41 UTC (permalink / raw)
  To: 50944

Package: emacs
Version: 28.0.60

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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#50944: malformed :safe entry in several defcustoms
  2021-10-01 15:41 bug#50944: malformed :safe entry in several defcustoms Glenn Morris
@ 2021-10-02 20:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-10-03 23:52   ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-10-02 20:01 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 50944

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


        Stefan






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#50944: malformed :safe entry in several defcustoms
  2021-10-02 20:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-10-03 23:52   ` Glenn Morris
  2021-10-04  9:32     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2021-10-03 23:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 50944

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#50944: malformed :safe entry in several defcustoms
  2021-10-03 23:52   ` Glenn Morris
@ 2021-10-04  9:32     ` Lars Ingebrigtsen
  2021-10-04 15:27       ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-04  9:32 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 50944, Stefan Monnier

Glenn Morris <rgm@gnu.org> writes:

>> The secondary bug here is that those errors should be flagged with
>> a warning.
>
> Run-time warning seems easy:

A compile-time warning would be nicer, I think.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#50944: malformed :safe entry in several defcustoms
  2021-10-04  9:32     ` Lars Ingebrigtsen
@ 2021-10-04 15:27       ` Glenn Morris
  0 siblings, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2021-10-04 15:27 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50944, Stefan Monnier

Lars Ingebrigtsen wrote:

>> Run-time warning seems easy:
>
> A compile-time warning would be nicer, I think.

Please make a separate bug report for this (this one is closed). Or a patch. :)

To be explicit, the failure mode causes the variable to not be
considered safe, so it's not an important issue, and should be obvious
if anyone actually tests their :safe property.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-04 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01 15:41 bug#50944: malformed :safe entry in several defcustoms Glenn Morris
2021-10-02 20:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-03 23:52   ` Glenn Morris
2021-10-04  9:32     ` Lars Ingebrigtsen
2021-10-04 15:27       ` Glenn Morris

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).