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

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

[elpa] externals/cape 6ff72e5253 067/146: Unify cape-ispell and cape-isp


From: ELPA Syncer
Subject: [elpa] externals/cape 6ff72e5253 067/146: Unify cape-ispell and cape-ispell-capf
Date: Sun, 9 Jan 2022 20:57:43 -0500 (EST)

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

    Unify cape-ispell and cape-ispell-capf
---
 cape.el | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/cape.el b/cape.el
index 9945f3b168..005c90f58b 100644
--- a/cape.el
+++ b/cape.el
@@ -472,21 +472,17 @@ SORT should be nil to disable sorting."
                       :valid 'substring :category 'cape-ispell))
 
 ;;;###autoload
-(defun cape-ispell-capf ()
-  "Ispell completion-at-point-function."
-  (when-let (bounds (bounds-of-thing-at-point 'word))
-    `(,(car bounds) ,(cdr bounds)
-      ,(cape--ispell-table bounds)
-      :exclusive no
-      ,@cape--ispell-properties)))
-
-;;;###autoload
-(defun cape-ispell ()
-  "Complete with Ispell at point."
-  (interactive)
-  (let ((bounds (or (bounds-of-thing-at-point 'word) (cons (point) (point)))))
-    (cape--complete (car bounds) (cdr bounds) (cape--ispell-table bounds)
-                    cape--ispell-properties)))
+(defun cape-ispell (&optional interactive)
+  "Complete with Ispell at point.
+If INTERACTIVE is nil the function acts like a capf."
+  (interactive (list t))
+  (if interactive
+      (let ((bounds (or (bounds-of-thing-at-point 'word) (cons (point) 
(point)))))
+        (cape--complete (car bounds) (cdr bounds) (cape--ispell-table bounds)
+                        cape--ispell-properties))
+    (when-let (bounds (bounds-of-thing-at-point 'word))
+      `(,(car bounds) ,(cdr bounds) ,(cape--ispell-table bounds)
+        :exclusive no ,@cape--ispell-properties))))
 
 (defvar cape--dict-properties
   (list :annotation-function (lambda (_) " Dict")



reply via email to

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