diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index 82ce1cbc673..00a73572fb1 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -400,6 +400,8 @@ then it searches *all* buffers." (defun dabbrev-capf () "Dabbrev completion function for `completion-at-point-functions'." + (or (stringp dabbrev--abbrev-char-regexp) + (dabbrev--reset-global-variables)) (let* ((abbrev (dabbrev--abbrev-at-point)) (beg (progn (search-backward abbrev) (point))) (end (progn (search-forward abbrev) (point)))