From 906fbfdf9c876275dff609580387271a056cebe2 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 21 Oct 2025 16:08:43 +0200 Subject: emacs: enforce the fill-column value to 75 on git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Magit will already default to 75, but set the `git-commit-fill-column' variable just to be safe. Moreover, when editing patch/diff files manually (e.g. editing a cover letter in the context of 'git format-patch --cover-letter'), these rules should also apply. Hence, set 'fill-column' locally to 75 as well. Signed-off-by: Miquel Sabaté Solà --- .config/emacs/init.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index acbf5df..b74f616 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -488,12 +488,19 @@ ;; Turn ref links into clickable buttons. (add-hook 'magit-process-mode-hook #'goto-address-mode) - ;; Git commit mode. + ;; Git commit mode. These `git-commit-*' variables are picked up by Magit + ;; automatically. (setq git-commit-summary-max-length 50 + git-commit-fill-column 75 git-commit-style-convention-checks '(overlong-summary-line non-empty-second-line)) (add-hook 'git-commit-mode-hook 'mssola/git-commit-hook)) +;; Set the fill-column to 75 for diff buffers (e.g. editing cover letters for +;; `git-send-email'). +(add-hook 'diff-mode-hook + (lambda () (setq-local fill-column 75))) + ;; Nicer diffs. (use-package magit-delta :when (executable-find "git-delta") -- cgit v1.2.3