From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: globalized minor modes and major mode hooks Date: Sat, 1 Aug 2009 13:01:06 +0200 Message-ID: <94528FBB-F3B6-4318-AF8D-AD1A70340889@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1074) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249124576 2942 80.91.229.12 (1 Aug 2009 11:02:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Aug 2009 11:02:56 +0000 (UTC) To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 01 13:02:49 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MXCMS-0004dD-Aa for ged-emacs-devel@m.gmane.org; Sat, 01 Aug 2009 13:02:48 +0200 Original-Received: from localhost ([127.0.0.1]:60513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXCMQ-0006Th-Nw for ged-emacs-devel@m.gmane.org; Sat, 01 Aug 2009 07:02:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXCKx-00061v-H3 for emacs-devel@gnu.org; Sat, 01 Aug 2009 07:01:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXCKr-0005zA-B5 for emacs-devel@gnu.org; Sat, 01 Aug 2009 07:01:13 -0400 Original-Received: from [199.232.76.173] (port=42344 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXCKq-0005yy-B5 for emacs-devel@gnu.org; Sat, 01 Aug 2009 07:01:08 -0400 Original-Received: from mail-ew0-f211.google.com ([209.85.219.211]:45071) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXCKp-00052z-LG for emacs-devel@gnu.org; Sat, 01 Aug 2009 07:01:07 -0400 Original-Received: by ewy7 with SMTP id 7so98962ewy.42 for ; Sat, 01 Aug 2009 04:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:content-type :content-transfer-encoding:subject:date:message-id:to:mime-version :x-mailer; bh=boKJnUatvJtrYJ9jeRi2SyPJZiHEMKit7SlL5eHpYx8=; b=etTtabeAf51G3c5gKPtXKy1eHLh4AJggVl7We8iuYHqvQiK/uEcCbDurqPi9Bptn4i 0/cwmM70QKB434t/bCJkXaMbvvUMe/GuR1b6N33P6FpK6q2gza32CKDM3pdAoyrsx2i8 oImjpfUgut2dWHyG7PUwJiakHxjYBHqyiOwP0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=J6VJR9Hf873TF003Ngcj1F3jgOhSVW/hXjZJqF3OPjnWpnIqBXhjN/wRH9XZ1seXVp Snv7vVXClyOvQzmwDlDrO7OB2ZFJmk9mWuyDpg11PO4J5pLiULvkIhmeoBupGPP0mbOo s8mJ7eYy9h0SF/GuvKCQaLOhC8dtftealiRy4= Original-Received: by 10.211.178.8 with SMTP id f8mr2176590ebp.91.1249124466829; Sat, 01 Aug 2009 04:01:06 -0700 (PDT) Original-Received: from dhcp-129-244.public.vu.nl (dhcp-129-244.public.vu.nl [130.37.244.129]) by mx.google.com with ESMTPS id 24sm1994328eyx.33.2009.08.01.04.01.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 01 Aug 2009 04:01:06 -0700 (PDT) X-Mailer: Apple Mail (2.1074) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113515 Archived-At: 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?