From: David Reitter <david.reitter@gmail.com>
To: Emacs Development <emacs-devel@gnu.org>
Subject: globalized minor modes and major mode hooks
Date: Sat, 1 Aug 2009 13:01:06 +0200 [thread overview]
Message-ID: <94528FBB-F3B6-4318-AF8D-AD1A70340889@gmail.com> (raw)
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 other threads:[~2009-08-01 11:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94528FBB-F3B6-4318-AF8D-AD1A70340889@gmail.com \
--to=david.reitter@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.