Emacs: make longlines-mode default for the compilation buffer

emacs

Is there a way to make longlines mode the default for just the *compilation* buffer?

Best Answer

There sure is; you add to the compilation-mode-hook, which is called any time you enter compilation mode, a function which sets longlines-mode. Add the following to your ~/.emacs, or some other such suitable place:

  (defun compilation-mode-longlines-hook ()
    "Set longlines-mode when entering compilation mode."
    (longlines-mode t))

  (add-hook 'compilation-mode-hook 'compilation-mode-longlines-hook)