From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#8613: "mode:" for minor-mode breaks set-visited-file-name Date: Mon, 09 May 2011 19:44:46 -0300 Message-ID: References: <3gk4dzo7h6.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1304981116 31120 80.91.229.12 (9 May 2011 22:45:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 9 May 2011 22:45:16 +0000 (UTC) Cc: 8613@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 10 00:45:12 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QJZCO-0005UO-3i for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 May 2011 00:45:08 +0200 Original-Received: from localhost ([::1]:39144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJZCN-0004mI-DJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 May 2011 18:45:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJZCK-0004l7-Hp for bug-gnu-emacs@gnu.org; Mon, 09 May 2011 18:45:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJZCJ-0000ta-Ie for bug-gnu-emacs@gnu.org; Mon, 09 May 2011 18:45:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJZCJ-0000tB-Dn for bug-gnu-emacs@gnu.org; Mon, 09 May 2011 18:45:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QJZCI-0003sR-Uj; Mon, 09 May 2011 18:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 May 2011 22:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8613 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8613-submit@debbugs.gnu.org id=B8613.130498109914882 (code B ref 8613); Mon, 09 May 2011 22:45:02 +0000 Original-Received: (at 8613) by debbugs.gnu.org; 9 May 2011 22:44:59 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJZCF-0003ry-BL for submit@debbugs.gnu.org; Mon, 09 May 2011 18:44:59 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJZCB-0003rl-LW for 8613@debbugs.gnu.org; Mon, 09 May 2011 18:44:56 -0400 Original-Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:35211 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QJZC5-0003q4-VK; Mon, 09 May 2011 18:44:50 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 00F6E66152; Mon, 9 May 2011 19:44:46 -0300 (ART) In-Reply-To: <3gk4dzo7h6.fsf@fencepost.gnu.org> (Glenn Morris's message of "Mon, 09 May 2011 18:05:25 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 09 May 2011 18:45:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46363 Archived-At: >> (string-match "-mode\\'" (symbol-name (car form)))))) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Does not compute. Not sure why it wouldn't compute, but I'll trust you on that one. > Anyway, that would work, tho' perhaps it could just be hard-coded in > hack-one-local-variable-eval-safep, since the safety of mode: is not > customizable at present, and having hooks with non-empty defaults is > sub-optimal. Agreed. As mentioned recently, I'm fine with a non-nil hook as long as it's preloaded and not defcustom. But I think safe-local-eval-functions would be a likely defcustom, so it should be nil. > The only reason I could see needing :safe as an argument was if someone > had some hypothetical minor-mode that for some reason was not safe. In > which case, passing ":safe nil" seems like the simplest thing to me, > rather than eg ":safe 'no", or inverting the whole thing to use :risky > instead of :safe. I prefer :risky. It's always handy to be able to do things like :foo (plist-get :foo), so ":foo nil" should behave the same as its absence. > But, there's no option to do this with mode:, so this is not needed to > replace mode: for minor-modes. Agreed. If/when we need it we can add a :risky. In the mean time if someone really needs it she can add a (put 'mode 'safe-local-eval-function nil) after the define-minor-mode. Stefan