From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: storm@cua.dk, rms@gnu.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Risky local variable mechanism
Date: Fri, 10 Feb 2006 18:31:05 -0600 (CST) [thread overview]
Message-ID: <200602110031.k1B0V5314136@raven.dms.auburn.edu> (raw)
In-Reply-To: <87k6c3ojyp.fsf@stupidchicken.com> (message from Chong Yidong on Fri, 10 Feb 2006 00:34:38 -0500)
Chong Yidong wrote:
! ;; 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 . t)
! (indent-tabs-mode . t)
! (page-delimiter . t)
! (paragraph-separate . t)
! (sentence-end . t)
! (sentence-end-double-space . t)
! (tab-width . integerp)
! (version-control . t)))
After some further thought, I would be very reluctant to use
(put 'myvar 'safe-local-variable t) for _any_ variable myvar. There
is no reason to give an unscrupulous person any chance to try to play
games with perverse values. So just always check that the value makes
sense. 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))))))
next prev parent reply other threads:[~2006-02-11 0:31 UTC|newest]
Thread overview: 99+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-31 23:09 Risky local variable mechanism Richard M. Stallman
2006-02-01 0:37 ` Stefan Monnier
2006-02-01 0:41 ` Luc Teirlinck
2006-02-01 2:39 ` Stefan Monnier
2006-02-02 4:17 ` Richard M. Stallman
2006-02-02 12:42 ` Kim F. Storm
2006-02-03 23:43 ` Richard M. Stallman
2006-02-04 4:34 ` Luc Teirlinck
2006-02-05 17:34 ` Richard M. Stallman
2006-02-06 6:00 ` Luc Teirlinck
2006-02-07 6:07 ` Richard M. Stallman
2006-02-07 2:47 ` Luc Teirlinck
2006-02-07 16:45 ` Chong Yidong
2006-02-08 1:49 ` Luc Teirlinck
2006-02-08 2:09 ` Chong Yidong
2006-02-08 2:18 ` Luc Teirlinck
2006-02-08 4:30 ` Chong Yidong
2006-02-08 4:56 ` Chong Yidong
2006-02-08 5:02 ` Luc Teirlinck
2006-02-08 5:00 ` Luc Teirlinck
2006-02-08 5:28 ` Chong Yidong
2006-02-08 3:13 ` Stefan Monnier
2006-02-08 4:51 ` Chong Yidong
2006-02-08 5:07 ` Stefan Monnier
2006-02-08 5:25 ` Chong Yidong
2006-02-08 6:00 ` Stefan Monnier
2006-02-08 13:35 ` Chong Yidong
2006-02-08 21:41 ` Stefan Monnier
2006-02-08 6:06 ` Luc Teirlinck
2006-02-08 6:49 ` Stefan Monnier
2006-02-08 5:48 ` Luc Teirlinck
2006-02-08 6:08 ` Stefan Monnier
2006-02-08 6:17 ` Luc Teirlinck
2006-02-08 6:48 ` Stefan Monnier
2006-02-09 17:47 ` Richard M. Stallman
2006-02-09 17:47 ` Richard M. Stallman
2006-02-10 23:57 ` Luc Teirlinck
2006-02-08 9:21 ` Juri Linkov
2006-02-08 12:48 ` Disabled commands (was: Risky local variable mechanism) Stefan Monnier
2006-02-09 17:48 ` Richard M. Stallman
2006-02-09 22:07 ` Disabled commands Stefan Monnier
2006-02-10 2:30 ` Miles Bader
2006-02-10 7:47 ` Eli Zaretskii
2006-02-13 8:36 ` Bill Wohler
2006-02-13 9:26 ` Kim F. Storm
2006-02-13 9:43 ` Giorgos Keramidas
2006-02-13 13:54 ` Romain Francoise
2006-02-09 18:46 ` Kevin Rodgers
2006-02-08 15:45 ` Risky local variable mechanism Drew Adams
2006-02-09 3:58 ` Luc Teirlinck
2006-02-09 17:48 ` Richard M. Stallman
2006-02-10 5:34 ` Chong Yidong
2006-02-10 17:03 ` Stefan Monnier
2006-02-10 17:54 ` Chong Yidong
2006-02-11 0:31 ` Luc Teirlinck [this message]
2006-02-12 1:00 ` Stefan Monnier
2006-02-12 4:30 ` Richard M. Stallman
2006-02-11 3:31 ` Luc Teirlinck
2006-02-12 1:02 ` Stefan Monnier
2006-02-12 1:15 ` Luc Teirlinck
2006-02-11 16:44 ` Richard M. Stallman
2006-02-14 1:33 ` Chong Yidong
2006-02-14 2:50 ` Luc Teirlinck
2006-02-14 22:17 ` Richard M. Stallman
2006-02-14 3:16 ` Luc Teirlinck
2006-02-14 3:32 ` Luc Teirlinck
2006-02-14 3:38 ` Luc Teirlinck
2006-02-14 3:48 ` Chong Yidong
2006-02-14 4:11 ` Luc Teirlinck
2006-02-14 4:26 ` Chong Yidong
2006-02-16 14:02 ` safe-local-variable additions (was: Risky local variable mechanism) Reiner Steib
2006-02-17 2:47 ` safe-local-variable additions Chong Yidong
2006-02-17 14:30 ` Reiner Steib
2006-02-02 12:47 ` Risky local variable mechanism Kim F. Storm
2006-02-01 2:30 ` Chong Yidong
2006-02-02 4:15 ` Richard M. Stallman
2006-02-02 9:54 ` David Kastrup
2006-02-02 14:54 ` Kim F. Storm
2006-02-03 5:04 ` Richard M. Stallman
[not found] <E1F46oA-0005O8-FC@monty-python.gnu.org>
2006-02-01 15:24 ` Jonathan Yavner
2006-02-01 17:00 ` Stefan Monnier
2006-02-01 23:31 ` Kim F. Storm
2006-02-02 5:05 ` Stefan Monnier
2006-02-01 23:12 ` Chong Yidong
2006-02-02 16:21 ` Richard M. Stallman
2006-02-02 17:00 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2006-02-02 8:14 LENNART BORGMAN
2006-02-10 18:13 risky " Jonathan Yavner
2006-02-11 3:19 ` Luc Teirlinck
2006-02-13 4:40 ` Richard M. Stallman
2006-02-11 17:08 ` Chong Yidong
2006-02-11 20:27 ` Jonathan Yavner
2006-02-11 20:46 ` Chong Yidong
2006-02-12 19:29 ` Richard M. Stallman
2006-02-12 19:52 ` Chong Yidong
2006-02-13 20:05 ` Richard M. Stallman
2006-02-13 21:03 ` Chong Yidong
2006-02-12 1:10 ` Luc Teirlinck
2006-02-12 19:29 ` Richard M. Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200602110031.k1B0V5314136@raven.dms.auburn.edu \
--to=teirllm@dms.auburn.edu \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=rms@gnu.org \
--cc=storm@cua.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).