aboutsummaryrefslogtreecommitdiff
path: root/.config/emacs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2025-10-21 16:08:43 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2025-10-21 19:41:56 +0200
commit906fbfdf9c876275dff609580387271a056cebe2 (patch)
tree4c0af4a3da245019614430830a8f34a9493a2823 /.config/emacs
parentffeda8b736495ba83037a267b270ea785e421a9f (diff)
downloaddotfiles-906fbfdf9c876275dff609580387271a056cebe2.tar.gz
dotfiles-906fbfdf9c876275dff609580387271a056cebe2.zip
emacs: enforce the fill-column value to 75 on git
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à <mssola@mssola.com>
Diffstat (limited to '.config/emacs')
-rw-r--r--.config/emacs/init.el9
1 files changed, 8 insertions, 1 deletions
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")