summaryrefslogtreecommitdiff
path: root/.config/emacs
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2025-10-18 09:55:39 +0200
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2025-10-20 20:19:57 +0200
commitb82d1fc91d5c41b535c390821c65f70ef232cdb8 (patch)
tree494b48e55283f30429f20ebed9b33da27749bd70 /.config/emacs
parentcdbd66e1a9e847fb7a28555a8f60eed134a222bd (diff)
downloaddotfiles-b82d1fc91d5c41b535c390821c65f70ef232cdb8.tar.xz
Make ChangeLog support in git-commit opt-in
Otherwise M-q becomes annoying when drafting commit messages for non-GNU projects, since it insists on inserting colons in '*' bullet lists.
Diffstat (limited to '.config/emacs')
-rw-r--r--.config/emacs/init.el16
1 files changed, 14 insertions, 2 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index 8eaf534..024a276 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -437,6 +437,15 @@ list and require no escaping."
(cl-return-from my/git-commit-maybe-set-fill-column
(setq fill-column column))))))
+(defvar my/git-commit-use-changelog
+ (list 'my/emacs-repo-p))
+
+(defun my/git-commit-maybe-set-changelog-support ()
+ (let ((remotes (my/git-upstreams)))
+ (when (run-hook-with-args-until-success
+ 'my/git-commit-use-changelog remotes)
+ (git-commit-setup-changelog-support))))
+
(defun my/revision-at-point ()
(cond
((derived-mode-p 'magit-mode)
@@ -888,8 +897,11 @@ UPSTREAMS is a list of fetch URLs."
(use-package git-commit
:config
(my/setopt-update-list
- git-commit-setup-hook '(git-commit-turn-on-flyspell
- my/git-commit-maybe-set-fill-column)))
+ git-commit-setup-hook
+ '(git-commit-turn-on-flyspell
+ my/git-commit-maybe-set-fill-column
+ my/git-commit-maybe-set-changelog-support)
+ '(git-commit-setup-changelog-support)))
(use-package gnus
:custom