aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-04-06 22:06:34 +0200
committerJonas Bernoulli <jonas@bernoul.li>2026-04-06 22:06:34 +0200
commit61950fca5e31c9a33d839b3994d93be6d370fb4c (patch)
treeb879e9fea11c87b4e1d3963492d17b9381fa263b /lisp
parentd527f8338613dd9ff7a43328e25065d1f3d7436e (diff)
git-commit-setup-capf: Work around bug in dabbrev-capf
Our wrapper function backports a bugfix from debbug#80645 / a7d05207214. It isn't needed for recent 31.0.50 builds. Closes #5551.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/git-commit.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index 9535c63..be11380 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -629,7 +629,14 @@ completing modified symbols and other text appearing in the diff."
(unless dabbrev--abbrev-char-regexp
;; Initialize (not "reset") variables. See #5545.
(dabbrev--reset-global-variables))
- (add-hook 'completion-at-point-functions #'dabbrev-capf -90 t))
+ ;; Our wrapper backports bugfix from debbug#80645 / a7d05207214. See #5551.
+ (add-hook 'completion-at-point-functions #'git-commit--dabbrev-capf -90 t))
+
+(defun git-commit--dabbrev-capf ()
+ (static-if (magit--version>= emacs-version "31.1")
+ (dabbrev-capf)
+ (cl-letf (((symbol-function #'user-error) (lambda (&rest _))))
+ (dabbrev-capf))))
(defun git-commit-setup-changelog-support ()
"Treat ChangeLog entries as unindented paragraphs."