[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: Mon, 08 May 2006 13:21:19 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

On Sat, Apr 29 2006, Dan Nicolaescu wrote:

> AFAIK to find out whether a variable is safe or not one has to read
> the source code. It would be nice to have describe-variable give this
> information. 

The output of `<f1> v TeX-master RET' now includes some byte-code:

,----[ <f1> v TeX-master RET ]
| TeX-master is a variable defined in `tex.el'.
| Its value is nil
| Automatically becomes buffer-local when set in any fashion.
| This variable is safe to use as a file local variable only if its value
| satisfies the predicate `#[(x) [BYTE-CODE stripped] [x (t nil shared dwim)] 
| [...]

To reproduce:

- emacs -Q

- C-x C-f new-file.el RET

- insert...

--8<---------------cut here---------------start------------->8---
(defvar rs-foo nil)
(put 'rs-foo 'safe-local-variable
     (lambda (x)
       (or (stringp x)
           (member x (quote (t nil shared dwim))))))
--8<---------------cut here---------------end--------------->8---

- C-x C-s

- M-x emacs-lisp-byte-compile-and-load RET

- <f1> v rs-foo RET

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]