3

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?

1 Answers1

7

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)))
Daimrod
  • 603