Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've activated visual line mode in Emacs with M-x global-visual-line-mode .

However (only) in Agenda buffers I'd like to autamatically use truncate long lines instead.

How can I enable that? Do I have to modify the agenda commands?

share|improve this question
up vote 4 down vote accepted

A hook is a list of functions ran on particular occasion. Most modes, if not all, have at least one hook, generally named <mode-name>-mode-hook, to which you can add functions with add-hook and remove functions with remove-hook.

You can see if a hook exists and inspect its value with C-hv<mode-name>-mode-hookRET.

In your case, you want to configure org-agenda-mode-hook.

(add-hook 'org-agenda-mode-hook
          (lambda ()
            (visual-line-mode -1)
            (toggle-truncate-lines 1)))
share|improve this answer
thanks, works perfectly :-) – MostlyHarmless Jan 10 '13 at 8:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.