From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: drkm Newsgroups: gmane.emacs.devel Subject: 'risky-local-variable-p' bug in regard of the 'safe-local-variable' property? Date: Sat, 18 Jun 2005 01:07:34 +0200 Organization: None Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1119050635 19220 80.91.229.2 (17 Jun 2005 23:23:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2005 23:23:55 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 18 01:23:52 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DjQBc-0007gL-TL for ged-emacs-devel@m.gmane.org; Sat, 18 Jun 2005 01:23:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DjQHK-0005Xi-I4 for ged-emacs-devel@m.gmane.org; Fri, 17 Jun 2005 19:29:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DjQER-0004CG-V8 for emacs-devel@gnu.org; Fri, 17 Jun 2005 19:26:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DjQEO-0004B3-F6 for emacs-devel@gnu.org; Fri, 17 Jun 2005 19:26:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DjQEM-0003ui-97 for emacs-devel@gnu.org; Fri, 17 Jun 2005 19:26:34 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DjPtX-0007ej-15 for emacs-devel@gnu.org; Fri, 17 Jun 2005 19:05:03 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DjPlb-0004sx-9n for emacs-devel@gnu.org; Sat, 18 Jun 2005 00:56:51 +0200 Original-Received: from 181-239.242.81.adsl.skynet.be ([81.242.239.181]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Jun 2005 00:56:51 +0200 Original-Received: from darkman_spam by 181-239.242.81.adsl.skynet.be with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Jun 2005 00:56:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 41 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 181-239.242.81.adsl.skynet.be User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:ILZ68+Io7fhVnn/PKzbzKHr+eW8= 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:39050 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39050 Hi Imagine I have some variable, for which 'risky-local-variable-p' returns 't'. But I want to change this, and say this variable is safe when I want to set it t 'nil'. So I use something like: (put '...-function 'safe-local-variable 'null) But 'risky-local-variable-p' ends with: (or (null val) (not (funcall safep val))))))) so it's not possible to say a variable is safe if I try to set it to 'nil'. Why? I don't understand this. And while it's correct in regard of the 'risky-local-variable-p' docstring: "Non-nil if SYM could be dangerous as a file-local variable with value VAL. If VAL is nil or omitted, the question is whether any value might be dangerous." it's not correct in regard of the manual (info: (elisp)File Local Variables): These rules can be overridden by giving the variable's name a non-`nil' `safe-local-variable' property. If one gives it a `safe-local-variable' property of `t', then one can give the variable any file local value. One can also give any symbol, including the above, a `safe-local-variable' property that is a function taking exactly one argument. In that case, giving a variable with that name a file local value is only allowed if the function returns non-`nil' when called with that value as argument. So what's the correct meaning of: (put '...-function 'safe-local-variable 'null) in this context? And why the "(or (null val) ..."? --drkm