From unknown Mon Aug 18 11:15:35 2025 X-Loop: don@donarmstrong.com Subject: bug#524: outdated (put ...) exceptions for evaled file-local variables Reply-To: Alex Shinn , 524@debbugs.gnu.org Resent-From: Alex Shinn Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 03 Jul 2008 06:55:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 524 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121506759320962 (code B ref -1); Thu, 03 Jul 2008 06:55:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.0 required=4.0 tests=BAYES_00,MURPHY_DRUGS_REL8, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Jul 2008 06:46:33 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m636kTGa020956 for ; Wed, 2 Jul 2008 23:46:31 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEIaL-0000ch-DH for bug-gnu-emacs@gnu.org; Thu, 03 Jul 2008 02:46:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEIaH-0000cJ-4K for bug-gnu-emacs@gnu.org; Thu, 03 Jul 2008 02:46:28 -0400 Received: from [199.232.76.173] (port=60236 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEIaG-0000cG-VR for bug-gnu-emacs@gnu.org; Thu, 03 Jul 2008 02:46:24 -0400 Received: from mx20.gnu.org ([199.232.41.8]:57215) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KEIaG-00081g-Gu for bug-gnu-emacs@gnu.org; Thu, 03 Jul 2008 02:46:24 -0400 Received: from rv-out-0708.google.com ([209.85.198.244]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KEIaB-0001j2-GE for bug-gnu-emacs@gnu.org; Thu, 03 Jul 2008 02:46:19 -0400 Received: by rv-out-0708.google.com with SMTP id k29so819480rvb.6 for ; Wed, 02 Jul 2008 23:46:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:subject:from:date :message-id:user-agent:mime-version:content-type; bh=5Ca7D7Lc54mmpItPCct+TUgncpGg3c1NkhWzKo7mT68=; b=ZgnJVCA+cr/bVgmpW/TJNxIFFCB0JF0uo4CR6Bye0LagYkeL9vwuF2ec9cJubRy5e/ jW5QzW+YnP9d7AdTW2lVjFDma/HTbbd0hAZuWS+C8PqcXK2jCAMFdun8dFVCMZ5uCh4x 60azySrYJkFRtvaPhkfnlwin/REOMnK7dWQQU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:subject:from:date:message-id:user-agent:mime-version :content-type; b=sdAmPjCdOtMUaTYqHC9duiY4us0GuFUYfaHL+rrfKUEttVgnZ/EHn9zOqwf0Mp9IIt 31ZXPk2udtcD8SyzjFXel4T9LoknIIpUqbN+H96StZ6T7Lql1YF6ygVeQcIos54qUR/e X7NjInIlOk4LmNli1es+SZVIFtHX1s9VuPaSQ= Received: by 10.114.178.13 with SMTP id a13mr7901625waf.158.1215067577654; Wed, 02 Jul 2008 23:46:17 -0700 (PDT) Received: from chernushka ( [163.221.157.46]) by mx.google.com with ESMTPS id m40sm14783795waf.46.2008.07.02.23.46.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Jul 2008 23:46:17 -0700 (PDT) To: bug-gnu-emacs@gnu.org From: Alex Shinn Date: Thu, 03 Jul 2008 15:44:53 +0900 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) --=-=-= 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 --=-=-=-- From unknown Mon Aug 18 11:15:35 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Alex Shinn Subject: bug#524 closed by Chong Yidong (Re: outdated (put ...) exceptions for evaled file-local variables) Message-ID: References: <878wvbqjd4.fsf@stupidchicken.com> X-Emacs-PR-Message: they-closed 524 X-Emacs-PR-Package: emacs Reply-To: 524@debbugs.gnu.org Content-Type: multipart/mixed; boundary="----------=_1217969705-18053-1" This is a multi-part message in MIME format... ------------=_1217969705-18053-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 . 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 by replying to this email. --=20 524: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D524 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1217969705-18053-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From cyd@stupidchicken.com Tue Aug 5 13:47:27 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.2 required=4.0 tests=AWL,BAYES_00, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 524-done) by emacsbugs.donarmstrong.com; 5 Aug 2008 20:47:27 +0000 Received: from cyd (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m75KlOIB016377 for <524-done@emacsbugs.donarmstrong.com>; Tue, 5 Aug 2008 13:47:26 -0700 Received: by cyd (Postfix, from userid 1000) id 99DB157E338; Tue, 5 Aug 2008 16:47:51 -0400 (EDT) From: Chong Yidong To: Alex Shinn Cc: 524-done@debbugs.gnu.org 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Thanks. I've checked your patch (with minor modifications) into the CVS trunk. ------------=_1217969705-18053-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From alexshinn@gmail.com Wed Jul 2 23:46:33 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.0 required=4.0 tests=BAYES_00,MURPHY_DRUGS_REL8, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Jul 2008 06:46:33 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m636kTGa020956 for ; Wed, 2 Jul 2008 23:46:31 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEIaL-0000ch-DH for bug-gnu-emacs@gnu.org; Thu, 03 Jul 2008 02:46:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEIaH-0000cJ-4K for bug-gnu-emacs@gnu.org; Thu, 03 Jul 2008 02:46:28 -0400 Received: from [199.232.76.173] (port=60236 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEIaG-0000cG-VR for bug-gnu-emacs@gnu.org; Thu, 03 Jul 2008 02:46:24 -0400 Received: from mx20.gnu.org ([199.232.41.8]:57215) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KEIaG-00081g-Gu for bug-gnu-emacs@gnu.org; Thu, 03 Jul 2008 02:46:24 -0400 Received: from rv-out-0708.google.com ([209.85.198.244]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KEIaB-0001j2-GE for bug-gnu-emacs@gnu.org; Thu, 03 Jul 2008 02:46:19 -0400 Received: by rv-out-0708.google.com with SMTP id k29so819480rvb.6 for ; Wed, 02 Jul 2008 23:46:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:subject:from:date :message-id:user-agent:mime-version:content-type; bh=5Ca7D7Lc54mmpItPCct+TUgncpGg3c1NkhWzKo7mT68=; b=ZgnJVCA+cr/bVgmpW/TJNxIFFCB0JF0uo4CR6Bye0LagYkeL9vwuF2ec9cJubRy5e/ jW5QzW+YnP9d7AdTW2lVjFDma/HTbbd0hAZuWS+C8PqcXK2jCAMFdun8dFVCMZ5uCh4x 60azySrYJkFRtvaPhkfnlwin/REOMnK7dWQQU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:subject:from:date:message-id:user-agent:mime-version :content-type; b=sdAmPjCdOtMUaTYqHC9duiY4us0GuFUYfaHL+rrfKUEttVgnZ/EHn9zOqwf0Mp9IIt 31ZXPk2udtcD8SyzjFXel4T9LoknIIpUqbN+H96StZ6T7Lql1YF6ygVeQcIos54qUR/e X7NjInIlOk4LmNli1es+SZVIFtHX1s9VuPaSQ= Received: by 10.114.178.13 with SMTP id a13mr7901625waf.158.1215067577654; Wed, 02 Jul 2008 23:46:17 -0700 (PDT) Received: from chernushka ( [163.221.157.46]) by mx.google.com with ESMTPS id m40sm14783795waf.46.2008.07.02.23.46.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Jul 2008 23:46:17 -0700 (PDT) To: bug-gnu-emacs@gnu.org Subject: outdated (put ...) exceptions for evaled file-local variables From: Alex Shinn Date: Thu, 03 Jul 2008 15:44:53 +0900 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) --=-=-= 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 --=-=-=-- ------------=_1217969705-18053-1--