[Top][All Lists]

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

Doing things only in a particular mode

From: Colin Yates
Subject: Doing things only in a particular mode
Date: Mon, 24 Aug 2015 15:49:54 +0100

(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?


Sent with my mu4e

reply via email to

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