diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2026-03-30 15:45:52 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2026-03-30 15:45:52 +0200 |
| commit | 9beb7ac0b51ad4f121b56d9c986b6be0a479997d (patch) | |
| tree | 7d972bcf0989966489d1b041f5e56a83abc839f4 /lisp/git-commit.el | |
| parent | 89a51310bd8f8087c44f7ac5c902cc82dddbbe2a (diff) | |
git-commit-setup-capf: Force dabbrev initialization
When using a package such as `company', which automatically performs
completion, it isn't guaranteed that `dabbrev--reset-global-variables'
has been called at least once, resulting in type error. So we have to
take care of the initialization.
Closes #5545.
Diffstat (limited to 'lisp/git-commit.el')
| -rw-r--r-- | lisp/git-commit.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/git-commit.el b/lisp/git-commit.el index 310a752..609c2e5 100644 --- a/lisp/git-commit.el +++ b/lisp/git-commit.el @@ -110,6 +110,7 @@ (require 'transient) (require 'with-editor) +(defvar dabbrev--abbrev-char-regexp) (defvar diff-default-read-only) (defvar flyspell-generic-check-word-predicate) (defvar font-lock-beg) @@ -119,6 +120,7 @@ (defvar git-commit-need-summary-line) (declare-function dabbrev-capf "dabbrev" ()) +(declare-function dabbrev--reset-global-variables "dabbrev" ()) (define-obsolete-variable-alias 'git-commit-known-pseudo-headers @@ -621,6 +623,9 @@ the input isn't tacked to the comment." When \"git commit\"'s \"--verbose\" argument is used, this allows completing modified symbols and other text appearing in the diff." (require 'dabbrev) + (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)) (defun git-commit-setup-changelog-support () |
