aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-04-11 14:36:08 +0200
committerJonas Bernoulli <jonas@bernoul.li>2026-04-11 14:36:08 +0200
commitb400caeb52fe67419d29713a0f16c8118a56f303 (patch)
treeda96f660ed0b46710b2147623ee82fdaf1f31bce /lisp
parent098e6a02f18d0bee27eab0ad9e3c18a49b18d63d (diff)
Backport dabbrev-capf bugfix permanently
Closes #5556.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/git-commit.el9
-rw-r--r--lisp/magit-base.el11
2 files changed, 12 insertions, 8 deletions
diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index be11380..9535c63 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -629,14 +629,7 @@ 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))
- ;; 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))))
+ (add-hook 'completion-at-point-functions #'dabbrev-capf -90 t))
(defun git-commit-setup-changelog-support ()
"Treat ChangeLog entries as unindented paragraphs."
diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index 5f5ec06..cdb8e20 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -1042,6 +1042,17 @@ setting `imenu--index-alist' to nil before calling that function."
(setq imenu--index-alist nil)
(which-function))
+(static-if (version< emacs-version "31.1")
+ (define-advice dabbrev-capf (:around (fn) git-commit)
+ "Backport bugfix from debbug#80645 / a7d05207214 / 31.1.
+See #5551 and #5556."
+ (cl-letf (((symbol-function #'user-error)
+ (lambda (format &rest args)
+ (unless (string-prefix-p "No dynamic expansion" format)
+ (signal 'user-error
+ (list (apply #'format-message format args)))))))
+ (funcall fn))))
+
;;; Kludges for Custom
(defun magit-custom-initialize-reset (symbol exp)