[OS X Emacs] Soft word wrap

Enrico Franconi franconi at inf.unibz.it
Sun Aug 2 11:41:08 EDT 2009

On 1 Aug 2009, at 13:13, David Reitter wrote:
> See below for an explanation of why I think this is happening.  I  
> think it's bad design and I hope something can be done about that.

I get from your message below that at least there should be a way to  
(un)set word-wrap *globally*. This would make me happier...

> Begin forwarded message:
>> From: David Reitter <david.reitter at gmail.com>
>> Date: August 1, 2009 1:01:06 PM GMT+02:00
>> To: Emacs Development <emacs-devel at gnu.org>
>> Subject: globalized minor modes and major mode hooks
>> 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?

More information about the MacOSX-Emacs mailing list