Skip to content

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

Open
@raek

Description

@raek

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions