emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#6040: closed (globalized minor modes - priority ov


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#6040: closed (globalized minor modes - priority over mode hook?)
Date: Thu, 06 Oct 2011 19:35:01 +0000

Your message dated Thu, 06 Oct 2011 15:34:07 -0400
with message-id <address@hidden>
and subject line Re: bug#6040: globalized minor modes - priority over mode hook?
has caused the debbugs.gnu.org bug report #6040,
regarding globalized minor modes - priority over mode hook?
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
6040: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6040
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- 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





--- End Message ---
--- Begin Message --- Subject: Re: bug#6040: globalized minor modes - priority over mode hook? Date: Thu, 06 Oct 2011 15:34:07 -0400 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]