[Top][All Lists]

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

Re: Risky local variable mechanism

From: Richard M. Stallman
Subject: Re: Risky local variable mechanism
Date: Sat, 11 Feb 2006 23:30:35 -0500

      This also automatically prevents problems if one later allows
    dangerous values and forgets to update the 'safe-local-variables
    property.  Why not something like:

       ! ;; Commonly-encountered local variables that are safe:
       ! (mapc (lambda (pair)
       !        (put (car pair) 'safe-local-variable (cdr pair)))
       !       '((compile-command  . stringp)
       !        (fill-column      . integerp)
       !        (fill-prefix      . (lambda (val) (or (not val) (stringp val))))
       !    ;; This is OK, because indent-tabs-mode is defined using
       !    ;; DEFVAR_BOOL and hence can only be set to t or nil. 
       !        (indent-tabs-mode . t)
       !        (page-delimiter   . stringp)
       !        (paragraph-separate . stringp)
       !        (sentence-end     . stringp)
       !        (sentence-end-double-space . (lambda (val) (memq val '(t nil))))
       !        (tab-width        . integerp)
       !        (version-control  . (lambda (val) (memq val '(t nil never))))))

That is a good idea.

reply via email to

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