Search code examples
emacs

emacs truncate mode for specific buffers?


In my ~/.emacs, I have

(global-visual-line-mode t)

However, this is making buffer-list hard to read if the emacs window is and narrow. How I can I set it up so I can have buffer-list (and potentially other buffers) to truncate mode?


Solution

  • Most modes have a hook that runs when the mode is set, usually named on the form ...-mode-hook. You could add to a modes' hook to truncate lines (effectively turning off visual-line-mode):

    (add-hook
     'some-mode-hook
     '(lambda ()
        (toggle-truncate-lines 1)
        )
     )