From b82d1fc91d5c41b535c390821c65f70ef232cdb8 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sat, 18 Oct 2025 09:55:39 +0200 Subject: 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. --- .config/emacs/init.el | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to '.config') 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 -- cgit v1.2.3