Skip to content

Set fill column and/or turn on auto fill mode #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
raek opened this issue May 15, 2012 · 1 comment
Open

Set fill column and/or turn on auto fill mode #6

raek opened this issue May 15, 2012 · 1 comment

Comments

@raek
Copy link

raek commented May 15, 2012

First, thanks for a great mode! I really like it.

I noticed that this mode highlights any portion of the first line that exceeds the recommended 50-character limit. A 72-character limit seems to be a common convention for the rest of the commit message [1]. Do you think it would be a good idea to codify this convention too?

auto-fill-mode makes it very easy to arrange paragraphs with line breaks near a certain column. Just press press M-q and the current paragraph will be reflowed. My first proposal is to set the fill-column variable to 72 when git-commit-mode is activated. This could be as simple as calling (setq fill-column 72), but since I'm pretty new at elisp I don't know the preferred way to set this on mode entry (preferably only in the commit message buffer).

My other proposal is to turn on auto-fill-mode automatically. In my experience the great majority of commit message lines are ordinary text, which should adhere to the 72-character rule. I think it makes sense to have it activated by default. What do you think?

References:
[1] http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

@raek
Copy link
Author

raek commented May 15, 2012

I did some thinkering and found out that (setq fill-column 72) does indeed only set the value buffer-locally. (The C-h v fill-column help was really useful.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant