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)] 
2]'.
| [...]
`----

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/


_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to