emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/cape 9111ad5101 043/146: Ensure that dabbrev is initial


From: ELPA Syncer
Subject: [elpa] externals/cape 9111ad5101 043/146: Ensure that dabbrev is initialized properly
Date: Sun, 9 Jan 2022 20:57:41 -0500 (EST)

branch: externals/cape
commit 9111ad51014a073a48d95fbee7ac86cdf612d6ba
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Ensure that dabbrev is initialized properly
---
 cape.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/cape.el b/cape.el
index 7c462042bf..5e8fbbbfa3 100644
--- a/cape.el
+++ b/cape.el
@@ -378,6 +378,8 @@ METADATA is optional completion metadata."
 ;;;###autoload
 (defun cape-dabbrev-capf ()
   "Ispell completion-at-point-function."
+  (require 'dabbrev)
+  (cape--dabbrev-reset)
   (let ((abbrev (ignore-errors (dabbrev--abbrev-at-point))))
     (when (and abbrev (not (string-match-p "\\s-" abbrev)))
       (let ((beg (progn (search-backward abbrev) (point)))
@@ -387,11 +389,15 @@ METADATA is optional completion metadata."
           :exclusive no
           ,@cape--dabbrev-properties)))))
 
-(defun cape--dabbrev-expansions (word)
-  "Find all dabbrev expansions for WORD."
+(defun cape--dabbrev-reset ()
+  "Reset dabbrev state."
   (let ((dabbrev-check-all-buffers nil)
         (dabbrev-check-other-buffers nil))
-    (dabbrev--reset-global-variables))
+    (dabbrev--reset-global-variables)))
+
+(defun cape--dabbrev-expansions (word)
+  "Find all dabbrev expansions for WORD."
+  (cape--dabbrev-reset)
   (let* ((inhibit-message t)
          (message-log-max nil)
          (min-len (+ cape-dabbrev-min-length (length word)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]