开发者

Emacs: Set fill-column in Change Log Mode

开发者 https://www.devze.com 2023-02-18 11:49 出处:网络
Very specific question that I hope is not too dumb. (setq-default fill-column 120) sets the width of the buffer fill to 120 columns. Default for me otherwise is 74.

Very specific question that I hope is not too dumb.

(setq-default fill-column 120) sets the width of the buffer fill to 120 columns. Default for me otherwise is 74.

This command, when put in my .emacs file, works for all major modes I use (C++, Perl, etc). However, it seems not to affect the Change Log major mode (change-log-mo开发者_StackOverflow社区de-hook). Do you know how I can set the fill-column for this mode?


First, you have to set it (I'm just making sure you got this part right):

(defun my-change-log-mode-hook ()
  (setq fill-column 120))

(add-hook 'change-log-mode-hook 'my-change-log-mode-hook)

Secondly, you have to make sure that there is no directory local variables setting that overrides this. For example, when editing the source code of Emacs itself, fill-column will be set to 74 for change log mode and 70 elsewhere, overriding the value you specified in µour hook. These are defined in files named .dir-locals.el and can be place in or above the directory that contains the edited file.

0

精彩评论

暂无评论...
验证码 换一张
取 消