[Top][All Lists]

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

Re: add info about safe-local-variable to describe-variable

From: Reiner Steib
Subject: Re: add info about safe-local-variable to describe-variable
Date: Wed, 10 May 2006 15:14:21 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

On Wed, May 10 2006, Richard Stallman wrote:

>     The predicate is a lambda expression which was bytecomplied [I'm not
>     sure if this is what you asked for].  I gave a recipe to reproduce in
>     my first mail.  FWIW, if I quote[1] the lambda expression in my
>     recipe, I get the expected result:
> In that case, I think the fix is just to quote it.
> Is there any reason NOT to do that?
> Maybe we should update something in the Lisp Manual
> advising people to quote lambda expressions in this case.

I've installed the following change.  Please adjust if necessary.

--8<---------------cut here---------------start------------->8---
--- variables.texi      02 May 2006 13:14:51 +0200      1.79
+++ variables.texi      10 May 2006 15:00:53 +0200      
@@ -1784,7 +1784,8 @@
 file variables standardly have @code{safe-local-variable} properties,
 including @code{fill-column}, @code{fill-prefix}, and
 @code{indent-tabs-mode}.  For boolean-valued variables that are safe,
-use @code{booleanp} as the property value.
+use @code{booleanp} as the property value.  Lambda expressions should
+be quoted so that @code{describe-variable} can display the predicate.
 @defopt safe-local-variable-values
 This variable provides another way to mark some variable values as
--8<---------------cut here---------------end--------------->8---

I still think we should avoid printing byte-code even in case third
party libraries forget to quote a lambda expression.  May I install
the following change in `describe-variable'?  (Suggestion for better
wording welcome.)

--8<---------------cut here---------------start------------->8---
--- help-fns.el 02 May 2006 13:14:50 +0200      1.87
+++ help-fns.el 10 May 2006 14:57:31 +0200      
@@ -642,10 +642,12 @@
                 (princ (if (stringp (car obsolete)) (car obsolete)
                          (format "use `%s' instead." (car obsolete))))
-             (when safe-var 
-               (princ "This variable is safe to use as a file local variable")
-               (princ (format " only if its value\nsatisfies the predicate 
-                              safe-var))
+             (when safe-var
+               (princ "This variable is safe to use as a file local variable ")
+               (princ "only if its value\nsatisfies the predicate ")
+               (princ (if (byte-code-function-p safe-var)
+                          "which is byte-compiled expression.\n"
+                        (format "`%s'.\n" safe-var)))
              (princ "Documentation:\n")
               (princ (or doc "Not documented as a variable.")))
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

reply via email to

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