Subject: bug#4148: mode: for a minor mode should turn on, not toggle the mode

From: Dan Nicolaescu <[email-masked]>
Date: Sun, 16 Aug 2009 18:49:53 -0700 (PDT)

Chong Yidong <[email-masked]> writes:

  > Dan Nicolaescu <[email-masked]> writes:
  > 
  > > 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?
  > 
  > I'm having trouble coming up with a test-case for testing this patch.
  > Do you have one?

Here's one:

$ cat foo.el
(add-hook 'change-log-mode-hook (lambda () (bug-reference-mode 1)))

$ cat emacs/.dir-locals.el

((nil . ((tab-width . 8)
         (fill-column . 70)))
 (c-mode . ((c-file-style . "GNU")))
 (text-mode . ((mode . auto-fill)))
 (change-log-mode . ((add-log-time-zone-rule . t)
                     (fill-column . 74)
                     (bug-reference-url-format
                      . "http://debbugs.gnu.org/cgi/bugreport.cgi?bug=%s")
                     (mode . bug-reference))))

;; arch-tag: fb93c160-e9fe-4184-aad1-e4f5daa11cbd

$ emacs -Q -l foo.el
C-x C-f emacs/lisp/ChangeLog

C-h v bug-reference-mode RET

before your patch bug-reference-mode is nil, after it's t