emacs-devel
[Top][All Lists]
Advanced

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

globalized minor modes and major mode hooks


From: David Reitter
Subject: globalized minor modes and major mode hooks
Date: Sat, 1 Aug 2009 13:01:06 +0200

Here's something that came up on the Emacs on OS X mailing list in conjunction with an Aquamacs preview based on 23.1.

A user wanted to know how to turn off word wrapping just for latex. Translated to GNU Emacs 23.1, this would be:

(add-hook 'latex-mode-hook
          (defun turn-off-word-wrap () (setq word-wrap nil)))

As a normal setting, we also have:

(global-visual-line-mode 1)

Now, switching to LaTeX mode:

(latex-mode)

What should the value of word-wrap be?

I expected that the specific, local mode-hook setting would override any global defaults defined by global-visual-line-mode. However, this is not the case. word-wrap is t.

Two questions:

1. What is a good route for a user without intimate knowledge of Emacs internals (specifically without knowing how global-visual-line-mode does its job) to debug this?

2. I suspect that the define-globalized-minor-mode macro is at fault, because the minor mode code is executed first (run-mode-hooks) before the minor mode is configured. If this is true, can this be changed?

If not, how are users supposed to set something like word-wrap for a major mode when the global mode is enabled?





reply via email to

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