emacs-devel
[Top][All Lists]
Advanced

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

Re: allout patch - more safe-local-variables, plus autoloads


From: Stefan Monnier
Subject: Re: allout patch - more safe-local-variables, plus autoloads
Date: Thu, 20 Apr 2006 13:34:54 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>     If we disallow t and want a quick&dirty replacement predicate for boolean
>     values, we can either introduce booleanp (seems like a good predicate to
>     have around anyway) or just use symbolp.

> symbolp is not correct; a boolean variable can have any Lisp object
> as its value.  If booleanp is mean to mean "is t or nil", that would
> also be incorrect.

The idea behind safe-local-variable, AFAIK, is to accept values which are
known to be safe.  It may reject valid values if they're not known to be
safe and that's OK because the user still gets a chance to accept
the value.

In the case of boolean variables, history shows that they have
a non-negligible chance of being extended in the future to give special
meaning to some other values (typically some other symbol, or to values
which are functions, ...).  So it's better to only consider as safe the
values nil and t which are least likely to change meaning (and become
potentially unsafe) in the future.

> I don't see any great need to eliminate t as a value,
> and certainly not at the cost of any real annoyance.

The intention is to force the author to think about which predicate to use,
in the hope it will reduce the number of cases where the safe-local-variable
predicate ends up accepting unsafe values as well.


        Stefan




reply via email to

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