From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Espen Newsgroups: gmane.emacs.help Subject: Re: Doing things only in a particular mode Date: Mon, 24 Aug 2015 11:18:41 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1440432021 24015 80.91.229.3 (24 Aug 2015 16:00:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Aug 2015 16:00:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 24 18:00:16 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZTuAO-0003VR-Px for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Aug 2015 18:00:12 +0200 Original-Received: from localhost ([::1]:54223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTuAO-0000kP-1J for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Aug 2015 12:00:12 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Injection-Info: mx02.eternal-september.org; posting-host="ad871ce417d1fb2ea3c87e49e48c0ae1"; logging-data="28408"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/K+mXUYfYwq570Oh4NXow/L3zuEfjCdq4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:SSEnhbcodjDZmeDq5GJ8g4jxuBE= Original-Xref: usenet.stanford.edu gnu.emacs.help:214512 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106798 Archived-At: Colin Yates writes: > (newbie warning). > > So I understand about (add-hook...) but I can't find the hook I > want. Basically, I have visual-line-mode turned on globally, but I want > to disable it when I view the headers in mu4e. > > The buffer is called *mu4e-headers* and I can see the major mode is > mu4e-headers but the following code has no effect: > > (add-hook 'mu4e-headers-hook > (lambda () > (visual-line-mode 0))) > > I am not sure how 'hooks' are created - I searched through the source > code for my4e-headers-hook but couldn't find it. > > Assuming this is the right approach, how can I say 'when the major mode > is X then do this'. What is the idiomatic Emacs way? Sorry, I know nothing about mu4e, but the docs seem pretty good. Here's where they describe the compose mode hook: http://www.djcbsoftware.nl/code/mu/mu4e/Compose-hooks.html#Compose-hooks Usually I do ^h m (help mode), and the help text mentions the hooks. -- Dan Espen