From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: /srv/bzr/emacs/trunk r100059: (bug-reference-url-format): Mark as `safe-local-variable' if the value Date: Wed, 28 Apr 2010 08:32:56 -0700 (PDT) Message-ID: <49686.130.55.132.217.1272468776.squirrel@webmail.lanl.gov> References: <87sk6go6v8.fsf@stupidchicken.com> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1272468822 30933 80.91.229.12 (28 Apr 2010 15:33:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 28 Apr 2010 15:33:42 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: "Sam Steingold" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 28 17:33:41 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O79Ge-0005p2-B9 for ged-emacs-devel@m.gmane.org; Wed, 28 Apr 2010 17:33:40 +0200 Original-Received: from localhost ([127.0.0.1]:48099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O79Gd-0006Mz-Lg for ged-emacs-devel@m.gmane.org; Wed, 28 Apr 2010 11:33:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O79GE-0006Cj-Hv for emacs-devel@gnu.org; Wed, 28 Apr 2010 11:33:14 -0400 Original-Received: from [140.186.70.92] (port=53648 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O79GD-0006Bq-CP for emacs-devel@gnu.org; Wed, 28 Apr 2010 11:33:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O79GB-0007HM-LW for emacs-devel@gnu.org; Wed, 28 Apr 2010 11:33:13 -0400 Original-Received: from proofpoint2.lanl.gov ([204.121.3.26]:33625) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O79G4-0007Dy-GI; Wed, 28 Apr 2010 11:33:04 -0400 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by proofpoint2.lanl.gov (8.14.3/8.14.3) with ESMTP id o3SFWvmv013276; Wed, 28 Apr 2010 09:32:57 -0600 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay1.lanl.gov (Postfix) with ESMTP id B29D7345ADC; Wed, 28 Apr 2010 09:32:56 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay1.lanl.gov Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 9EA4A345ADB; Wed, 28 Apr 2010 09:32:56 -0600 (MDT) Original-Received: by webmail1.lanl.gov (Postfix, from userid 48) id 9B0251CA8396; Wed, 28 Apr 2010 09:32:56 -0600 (MDT) Original-Received: from 130.55.132.217 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Wed, 28 Apr 2010 08:32:56 -0700 (PDT) In-Reply-To: User-Agent: SquirrelMail/1.4.8-5.el5_4.10.lanl1 X-Priority: 3 (Normal) Importance: Normal X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2010-04-28_09:2010-02-06, 2010-04-28, 2010-04-28 signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:124298 Archived-At: > (put 'bug-reference-url-format 'safe-local-variable > (let ((f (get 'bug-reference-url-format 'safe-local-variable))) > (lambda (s) (or (funcall f s) (eq s > 'clisp-bug-reference-url-format))))) That won't work if the existing value is not a function (e.g. if it is t (which would be foolish, of course) or nil). Moreover, you need to use backquotes: (let ((f ...)) `(lambda (s) (or (funcall ,f s) ...))) (this is one of the reasons people want lexbind). > so that if others do that too, I will not override them. > in fact, maybe the above should be a standard function > (add-safe-value variable symbol) I don't know how often it is useful to be able to add many individual safe values for a variable; perhaps instead there should be another variable whose file-local value can be a string s from which `bug-reference-url-format' is calculated as (intern (concat s "-url-format")). Then only functions intended for the purpose could be selected by the file. Or, more generally, perhaps there should be a symbol property `safe-file-function' placed on symbols whose values as functions were safe to call regardless of context, so that we could then allow precisely those symbols as the values of certain function-valued file locals: (put 'clisp-bug-reference-url-format 'safe-file-function t) (defun safe-file-function-p (f) (and (symbolp f) (get f 'safe-file-function)) (put 'bug-reference-url-format 'safe-local-variable 'safe-file-function-p) Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.