GNU bug report logs - #6040
globalized minor modes - priority over mode hook?

Previous Next

Package: emacs;

Reported by: David Reitter <david.reitter <at> gmail.com>

Date: Mon, 26 Apr 2010 16:15:02 UTC

Severity: normal

Fixed in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6040 in the body.
You can then email your comments to 6040 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, help-debbugs <at> gnu.org:
bug#6040; Package debbugs.gnu.org. (Mon, 26 Apr 2010 16:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to David Reitter <david.reitter <at> gmail.com>:
New bug report received and forwarded. Copy sent to help-debbugs <at> gnu.org. (Mon, 26 Apr 2010 16:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: David Reitter <david.reitter <at> gmail.com>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: "emacs-devel <at> gnu.org devel" <emacs-devel <at> gnu.org>
Subject: Re: globalized minor modes - priority over mode hook?
Date: Mon, 26 Apr 2010 11:41:06 -0400
On Apr 26, 2010, at 10:30 AM, Stefan Monnier wrote:

>> `run-mode-hooks' runs the mode hooks first, then
>> after-change-major-mode-hooks.
> 
> That would be a bug.  Do you have a recipe to reproduce it?

Yes, below.

Looking at the code of `after-find-file', I think file-local variables will similarly be overruled by the global minor mode.

I ended up implementing what I wanted below by setting defaults for `auto-fill-function', but that's more low-level than intended, obviously.

I'm bcc'ing the bug DB.

---
Emacs -Q

(add-hook 'text-mode-hook 'turn-on-word-wrap) ; turns OFF auto-fill

(defvaralias 'auto-fill-mode 'auto-fill-function)  ; kludge
(define-globalized-minor-mode global-auto-fill-mode auto-fill-mode turn-on-auto-fill)

(defun turn-on-word-wrap ()
  "Turn on Word Wrap mode in current buffer."
  (turn-off-auto-fill)
  (turn-on-visual-line-mode))

;; demo

(global-auto-fill-mode 1)  ; set default
(text-mode)

;; result: auto-fill-mode is on, even though it is intended to be off






bug reassigned from package 'debbugs.gnu.org' to 'emacs'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 26 Apr 2010 16:33:01 GMT) Full text and rfc822 format available.

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Thu, 06 Oct 2011 19:35:01 GMT) Full text and rfc822 format available.

Notification sent to David Reitter <david.reitter <at> gmail.com>:
bug acknowledged by developer. (Thu, 06 Oct 2011 19:35:02 GMT) Full text and rfc822 format available.

Message #12 received at 6040-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 6040-done <at> debbugs.gnu.org
Subject: Re: bug#6040: globalized minor modes - priority over mode hook?
Date: Thu, 06 Oct 2011 15:34:07 -0400
Version: 24.1

David Reitter wrote:

> Emacs -Q
>
> (add-hook 'text-mode-hook 'turn-on-word-wrap) ; turns OFF auto-fill
>
> (defvaralias 'auto-fill-mode 'auto-fill-function)  ; kludge
> (define-globalized-minor-mode global-auto-fill-mode auto-fill-mode turn-on-auto-fill)
>
> (defun turn-on-word-wrap ()
>   "Turn on Word Wrap mode in current buffer."
>   (turn-off-auto-fill)
>   (turn-on-visual-line-mode))
>
> ;; demo
>
> (global-auto-fill-mode 1)  ; set default
> (text-mode)
>
> ;; result: auto-fill-mode is on, even though it is intended to be off


I see this in 23.3 but not the current trunk, so it looks like this was
fixed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 04 Nov 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.