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: Thu, 05 May 2011 09:40:20 -0300 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1304599272 18961 80.91.229.12 (5 May 2011 12:41:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 May 2011 12:41:12 +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 Thu May 05 14:41:07 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 1QHxrf-0007Xz-Gd for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 May 2011 14:41:07 +0200 Original-Received: from localhost ([::1]:40056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHxrf-0002v8-3w for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 May 2011 08:41:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHxrb-0002un-S0 for bug-gnu-emacs@gnu.org; Thu, 05 May 2011 08:41:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHxra-0005aO-RA for bug-gnu-emacs@gnu.org; Thu, 05 May 2011 08:41:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHxra-0005aK-Pg for bug-gnu-emacs@gnu.org; Thu, 05 May 2011 08:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QHxra-00075D-7I; Thu, 05 May 2011 08:41: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: Thu, 05 May 2011 12:41: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.130459923127187 (code B ref 8613); Thu, 05 May 2011 12:41:02 +0000 Original-Received: (at 8613) by debbugs.gnu.org; 5 May 2011 12:40:31 +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 1QHxr4-00074S-GJ for submit@debbugs.gnu.org; Thu, 05 May 2011 08:40:30 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QHxr1-00074F-K0 for 8613@debbugs.gnu.org; Thu, 05 May 2011 08:40:28 -0400 Original-Received: from 121-249-126-200.fibertel.com.ar ([200.126.249.121]:24709 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QHxqw-000603-7D; Thu, 05 May 2011 08:40:22 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 4C5DD66168; Thu, 5 May 2011 09:40:20 -0300 (ART) In-Reply-To: (Glenn Morris's message of "Wed, 04 May 2011 22:20:00 -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: Thu, 05 May 2011 08:41: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:46236 Archived-At: >> Not a bad idea, tho I'd much rather add >> a (run-hook-with-args-until-success 'safe-local-eval-functions) >> instead rather than rely on regexps. > Regexps were the only way I could think of that did not require changes > to the definition of each minor mode, however... With a safe-local-eval-functions, you can do (add-hook 'safe-local-eval-functions (lambda (form) (and (null (cdr form)) (symbolp (car form)) (string-match "-mode\\'" (symbol-name (car form)))))) >> Another option is to let define-minor-mode place >> a `safe-local-eval-function' property on the minor-mode's symbol. > ... that's nice and simple (I didn't know `safe-local-eval-function' > existed); but I had to tweak make-autoload to get it to work right with > autoloaded minor-modes (eg outline-minor). > *** lisp/emacs-lisp/autoload.el 2011-05-04 15:38:41 +0000 > --- lisp/emacs-lisp/autoload.el 2011-05-05 02:14:30 +0000 > *************** > *** 190,195 **** > --- 190,197 ---- > (if (member ',file loads) nil > (put ',groupname 'custom-loads (cons ',file loads)))))) > > + ((eq car 'put) form) > + > ;; nil here indicates that this is not a special autoload form. > (t nil)))) Hmm... that will affect the (push (nth 1 form) autoloads-done). Not sure if it matters. > *** lisp/emacs-lisp/easy-mmode.el 2011-01-25 04:08:28 +0000 > --- lisp/emacs-lisp/easy-mmode.el 2011-05-05 00:44:36 +0000 > *************** > *** 115,120 **** > --- 115,122 ---- > :lighter SPEC Same as the LIGHTER argument. > :keymap MAP Same as the KEYMAP argument. > :require SYM Same as in `defcustom'. > + :safe PROP Set the MODE function's `safe-local-eval-function' property > + to PROP (default t). Not sure if we need it (currently all the -mode functions are presumed safe when called without argument, as in the "mode:" cookie). But if we do need it, it's better to reverse the meaning since we should usually aim to make ":prop nil" behave the same as when it's absent. Stefan