From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: allout patch - more safe-local-variables, plus autoloads Date: Tue, 18 Apr 2006 09:18:41 -0400 Message-ID: <8764l7m40w.fsf-monnier+emacs@gnu.org> References: <2cd46e7f0604171211s5ef0e820gebc4e68b2ce2606d@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1145366351 5138 80.91.229.2 (18 Apr 2006 13:19:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Apr 2006 13:19:11 +0000 (UTC) Cc: Ken Manheimer , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 18 15:19:09 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FVq6h-0001NU-4q for ged-emacs-devel@m.gmane.org; Tue, 18 Apr 2006 15:19:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FVq6g-0004dm-9K for ged-emacs-devel@m.gmane.org; Tue, 18 Apr 2006 09:19:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FVq6U-0004dX-3B for emacs-devel@gnu.org; Tue, 18 Apr 2006 09:18:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FVq6R-0004dL-Ku for emacs-devel@gnu.org; Tue, 18 Apr 2006 09:18:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FVq6R-0004dI-Ez for emacs-devel@gnu.org; Tue, 18 Apr 2006 09:18:47 -0400 Original-Received: from [209.226.175.4] (helo=tomts16-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FVq7J-0001NQ-BW; Tue, 18 Apr 2006 09:19:41 -0400 Original-Received: from alfajor ([70.53.192.213]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060418131845.WKJH27612.tomts16-srv.bellnexxia.net@alfajor>; Tue, 18 Apr 2006 09:18:45 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 729E2D7C8B; Tue, 18 Apr 2006 09:18:41 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Tue, 18 Apr 2006 08:57:44 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53006 Archived-At: > I see that you've used t as the property value. > That allows any type of value. > Most of these variables are supposed to be strings. > I don't know what would happen if they were set to other types; > did you check each one? > It would be safer to use stringp as the property value > for a variable that is supposed to be a string. BTW, I thought we had decided not to support the special case t to mean "any value is safe" and instead force the use of explicit predicates (which can still be (lambda (x) t), of course: you can make it harder for people to shoot themselves in the foot, but you can't prevent them from doing so if they're sufficiently motivated). Shouldn't we do that (basically the patch below, plus many other patches to fix all the places where we use t). Stefan --- files.el 13 avr 2006 10:22:03 -0400 1.826 +++ files.el 18 avr 2006 09:10:34 -0400 @@ -2643,15 +2643,11 @@ * There is a matching entry (SYM . VAL) in the `safe-local-variable-values' user option. - * The `safe-local-variable' property of SYM is t. - * The `safe-local-variable' property of SYM is a function that evaluates to a non-nil value with VAL as an argument." (or (member (cons sym val) safe-local-variable-values) (let ((safep (get sym 'safe-local-variable))) - (or (eq safep t) - (and (functionp safep) - (funcall safep val)))))) + (and (functionp safep) (funcall safep val))))) (defun risky-local-variable-p (sym &optional ignored) "Non-nil if SYM could be dangerous as a file-local variable.