I would like to set the fill-column
in Emacs to 120 for Clojure-mode, but leave it at the default (80) otherwise.
How can I do this in my .emacs
file?
Thanks.
I would like to set the fill-column
in Emacs to 120 for Clojure-mode, but leave it at the default (80) otherwise.
How can I do this in my .emacs
file?
Thanks.
Add a call to set-fill-column
to the clojure-mode-hook
.
(add-hook 'clojure-mode-hook
(lambda ()
(set-fill-column 120)))
As fill-column
is buffer local, it won't affect other buffers. In fact, you can invoke M-x set-fill-column RET 120
to set the fill column in any Emacs buffer interactively.
You can check if a variable is buffer local by invoking the help: C-h v fill-column
specifies:
Automatically becomes buffer-local when set in any fashion.
fill-column is a buffer-local variable, i.e. it can have unique value in each buffer (if you want). So you can just set it in clojure-mode hook.