[Top][All Lists]

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

[elpa] master c0db364 008/110: Add avy-action-ispell to avy.el

From: Oleh Krehel
Subject: [elpa] master c0db364 008/110: Add avy-action-ispell to avy.el
Date: Sat, 11 May 2019 10:15:33 -0400 (EDT)

branch: master
commit c0db3642d65eba76df8c7ee5c98042faecf79c4d
Author: Emmanuel Denloye-Ito <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Add avy-action-ispell to avy.el
    The point should return to its starting location after the desired word
    is corrected. As is the case for the other avy-action-{something}
    functions, this function is also added to the avy-dispatch-alist.
    Fixes #142
 avy.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/avy.el b/avy.el
index 20edd7b..3b8f37d 100644
--- a/avy.el
+++ b/avy.el
@@ -523,6 +523,17 @@ Set `avy-style' according to COMMMAND as well."
   (message "Killed: %s" (current-kill 0)))
+(defun avy-action-ispell (pt)
+  "Auto correct word at PT."
+  (save-excursion
+    (goto-char pt)
+    (if (looking-at-p "\\b")
+        (ispell-word)
+      (progn
+        (backward-word)
+        (when (looking-at-p "\\b")
+          (ispell-word))))))
 (defun avy--process (candidates overlay-fn)
   "Select one of CANDIDATES using `avy-read'.
 Use OVERLAY-FN to visualize the decision overlay."

reply via email to

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