How do I set the Emacs fill-column for a specific mode?

只愿长相守 提交于 2019-12-03 06:01:34

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!