all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#524: outdated (put ...) exceptions for evaled file-local variables
@ 2008-07-03  6:44 ` Alex Shinn
  2008-08-05 20:55   ` bug#524: marked as done (outdated (put ...) exceptions for evaled file-local variables) Emacs bug Tracking System
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Shinn @ 2008-07-03  6:44 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: files.el.diff --]
[-- Type: text/x-patch, Size: 917 bytes --]

--- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#524: marked as done (outdated (put ...) exceptions for evaled file-local variables)
  2008-07-03  6:44 ` bug#524: outdated (put ...) exceptions for evaled file-local variables Alex Shinn
@ 2008-08-05 20:55   ` Emacs bug Tracking System
  0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2008-08-05 20:55 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]


Your message dated Tue, 05 Aug 2008 16:47:51 -0400
with message-id <878wvbqjd4.fsf@stupidchicken.com>
and subject line Re: outdated (put ...) exceptions for evaled file-local variables
has caused the Emacs bug report #524,
regarding outdated (put ...) exceptions for evaled file-local variables
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
524: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=524
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 5494 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 1151 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2.1.2: files.el.diff --]
[-- Type: text/x-patch, Size: 917 bytes --]

--- 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

[-- Attachment #3: Type: message/rfc822, Size: 1051 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: Alex Shinn <alexshinn@gmail.com>
Cc: 524-done@emacsbugs.donarmstrong.com
Subject: Re: outdated (put ...) exceptions for evaled file-local variables
Date: Tue, 05 Aug 2008 16:47:51 -0400
Message-ID: <878wvbqjd4.fsf@stupidchicken.com>

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-05 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <878wvbqjd4.fsf@stupidchicken.com>
2008-07-03  6:44 ` bug#524: outdated (put ...) exceptions for evaled file-local variables Alex Shinn
2008-08-05 20:55   ` bug#524: marked as done (outdated (put ...) exceptions for evaled file-local variables) Emacs bug Tracking System

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.