I use several minor modes, which are enabled globally by default:
whitespace-mode
linum-mode
fci-mode
I'm finding them very helpful when editing code sources and text files, however I does not want to activate them with some major modes, e.g. dired-mode
, eshell
.
I've tried to solve this as following:
(add-hook 'prog-mode-hook '(linum-mode 1))
(require 'whitespace)
(add-hook 'prog-mode-hook '(whitespace-mode 1))
(require 'fill-column-indicator)
(add-hook 'prog-mode-hook '(fci-mode 1))
(add-hook 'text-mode-hook '(fci-mode 1))
But this solution does not works well:
- reverting buffer toggles off
linum-mode
whitespace-mode
not activatingfci-mode
not activating, producing error messageFile mode specification error: (invalid-function (fci-mode 1)) [2 times]
P.S. A note about fci-mode
: error message looks odd to me, because I can either use M-x fci-mode
to toggle it, or evaluate (fci-mode 1)
or (fci-mode -1)
.
GNU Emacs 24.4.2 (x86_64-apple-darwin14.1.0, Carbon Version 157 AppKit 1344.72) of 2015-02-05