Subject: bug#524 closed by Chong Yidong <[email-masked]> (Re: outdated (put ...) exceptions for evaled file-local variables)

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#524: outdated (put ...) exceptions for evaled file-local variables

It has been closed by Chong Yidong <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Chong Yidong <[email-masked]> by
replying to this email.

-- 
524: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=524
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Tue Aug  5 13:47:27 2008
From: Chong Yidong <[email-masked]>
To: Alex Shinn <[email-masked]>
Cc: [email-masked]
Subject: Re: outdated (put ...) exceptions for evaled file-local variables
Date: Tue, 05 Aug 2008 16:47:51 -0400

Thanks.  I've checked your patch (with minor modifications) into the CVS
trunk.

>From [email-masked] Wed Jul  2 23:46:33 2008
To: [email-masked]
Subject: outdated (put ...) exceptions for evaled file-local variables
From: Alex Shinn <[email-masked]>
Date: Thu, 03 Jul 2008 15:44:53 +0900

--=-=-=

Currently `hack-one-local-variable-eval-safep' has a few
manually checked exceptions for the `eval' pseudo-variable,
so that the common cases of setting indent and edebug
properties for symbols is considered safe automatically.

However, the indent property checks for `lisp-indent-hook',
which as far as I can tell is deprecated.  It's not
mentioned anywhere in the docs, and lisp-mode.el only uses
it as a fallback in case the `lisp-indent-function' property
isn't set.  All the properties in lisp-mode.el are set as
`lisp-indent-function'.

A simple fix would be to allow either.  I've attached a
potential patch that does this, and also allows
scheme-indent-function, since this case is also common and I
don't think there are many other modes that make use of
symbol indent-function properties.  I'd understand if you
didn't want to support Scheme by default though, in which
case I'd just resort to using `safe-local-eval-function'.

A more general fix might be to implement a separate
customization for which properties are automatically
settable with which values, with perhaps more broad default
settings than Emacs currently has.

-- 
Alex

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=files.el.diff

--- files.el~	2008-03-02 04:28:15.000000000 +0900
+++ files.el	2008-07-03 15:23:48.000000000 +0900
@@ -2846,10 +2846,14 @@
 	   (hack-one-local-variable-quotep (nth 1 exp))
 	   (hack-one-local-variable-quotep (nth 2 exp))
 	   (let ((prop (nth 1 (nth 2 exp))) (val (nth 3 exp)))
-	     (cond ((eq prop 'lisp-indent-hook)
+	     (cond ((memq prop '(lisp-indent-hook
+                                 lisp-indent-function
+                                 scheme-indent-function))
 		    ;; Only allow safe values of lisp-indent-hook;
 		    ;; not functions.
-		    (or (numberp val) (equal val ''defun)))
+		    (or (numberp val)
+                        (and (hack-one-local-variable-quotep val)
+                             (memq (nth 1 val) '(defun scheme-let-indent)))))
 		   ((eq prop 'edebug-form-spec)
 		    ;; Only allow indirect form specs.
 		    ;; During bootstrapping, edebug-basic-spec might not be

--=-=-=--