Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 3 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 :-) –  Martin Jan 10 '13 at 8:10

Your Answer

 
discard

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.