From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#4148: mode: for a minor mode should turn on, not toggle the mode Date: Sat, 15 Aug 2009 11:54:28 -0700 (PDT) Message-ID: <200908151854.n7FIsSHk009145@godzilla.ics.uci.edu> References: <874os9vuvd.fsf@cyd.mit.edu> Reply-To: Dan Nicolaescu , 4148@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1250363231 23394 80.91.229.12 (15 Aug 2009 19:07:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Aug 2009 19:07:11 +0000 (UTC) Cc: 4148@emacsbugs.donarmstrong.com To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 15 21:07:03 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1McOak-0007px-Vn for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Aug 2009 21:07:03 +0200 Original-Received: from localhost ([127.0.0.1]:46943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McOak-00029V-E2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Aug 2009 15:07:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1McOag-00029G-8w for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 15:06:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1McOaa-00028G-Jm for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 15:06:56 -0400 Original-Received: from [199.232.76.173] (port=34227 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McOaa-000285-Fu for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 15:06:52 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55332) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1McOaZ-0008Qg-Pc for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 15:06:52 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7FJ6n3r026627; Sat, 15 Aug 2009 12:06:50 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7FJ04cE024643; Sat, 15 Aug 2009 12:00:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 15 Aug 2009 19:00:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4148 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4148-submit@emacsbugs.donarmstrong.com id=B4148.125036248723709 (code B ref 4148); Sat, 15 Aug 2009 19:00:04 +0000 Original-Received: (at 4148) by emacsbugs.donarmstrong.com; 15 Aug 2009 18:54:47 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from barrelv2.ics.uci.edu (barrelv2.ics.uci.edu [128.195.1.114]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7FIskew023701 for <4148@emacsbugs.donarmstrong.com>; Sat, 15 Aug 2009 11:54:47 -0700 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by barrelv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n7FIsSpR025445; Sat, 15 Aug 2009 11:54:28 -0700 (PDT) Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n7FIsSHk009145; Sat, 15 Aug 2009 11:54:28 -0700 (PDT) In-Reply-To: <874os9vuvd.fsf@cyd.mit.edu> (Chong Yidong's message of "Sat, 15 Aug 2009 13:40:06 -0400") Original-Lines: 44 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n7FIsSpR025445 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 15 Aug 2009 15:06:56 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30210 Archived-At: Chong Yidong writes: > > A well known long standing problem: > > using > > mode: SOME_MINOR_MODE > > > in a local variable section (or in .dir-locals.el) toggles the minor > > mode, it should turn it on. > > > So if the user sets a hook to turn on the minor mode in her emacs, when > > using a file that sets the same minor mode, the minor mode ends up being > > disable. > > Does this patch DTRT? > > *** trunk/lisp/files.el.~1.1066.~ 2009-08-14 19:37:09.000000000 -0400 > --- trunk/lisp/files.el 2009-08-15 13:37:24.000000000 -0400 > *************** > *** 3189,3195 **** > "-mode")))) > (unless (eq (indirect-function mode) > (indirect-function major-mode)) > ! (funcall mode)))) > ((eq var 'eval) > (save-excursion (eval val))) > (t > --- 3189,3199 ---- > "-mode")))) > (unless (eq (indirect-function mode) > (indirect-function major-mode)) > ! (if (memq mode minor-mode-list) > ! ;; For a minor mode, enable unconditionally instead > ! ;; of toggling (since the mode may already be on). > ! (funcall mode 1) > ! (funcall mode))))) > ((eq var 'eval) > (save-excursion (eval val))) > (t Thanks, it seems to work fine. After this gets checked in, we can re-add (mode . bug-reference) to emacs/.dir-locals.el Any chance this patch can get onto the next release branch?