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

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

[elpa] externals/jinx 0f62c68620 8/9: Improve jinx-correct-at-point


From: ELPA Syncer
Subject: [elpa] externals/jinx 0f62c68620 8/9: Improve jinx-correct-at-point
Date: Mon, 11 Sep 2023 12:58:18 -0400 (EDT)

branch: externals/jinx
commit 0f62c686204eef0a2435a68f6912d6c62dd68dc5
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Improve jinx-correct-at-point
---
 CHANGELOG.org |  4 +++-
 README.org    | 11 ++++++-----
 jinx.el       |  5 +++--
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/CHANGELOG.org b/CHANGELOG.org
index ba2822366b..2936f5ff04 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -9,7 +9,9 @@
 - Replace =jinx-excluded-modes= with =global-jinx-modes=, the Emacs 28 
convention
   for globalized minor modes.
 - =jinx-correct=: Offer session words as suggestions.
-- Add =jinx-correct-nearest=, =jinx-correct-all= and =jinx-correct-at-point= 
commands. The command =jinx-correct= dispatches to one of those commands 
depending on the prefix argument.
+- Add =jinx-correct-nearest=, =jinx-correct-all= and =jinx-correct-at-point= 
commands.
+  The command =jinx-correct= dispatches to one of those commands depending on 
the
+  prefix argument.
 
 * Version 0.9 (2023-07-02)
 
diff --git a/README.org b/README.org
index 6949cb8d76..1d32893ecf 100644
--- a/README.org
+++ b/README.org
@@ -68,10 +68,10 @@ command, =jinx-mode=, for activating for specific modes.
   (add-hook hook #'jinx-mode))
 #+end_src
 
-The commands =jinx-correct= and =jinx-languages= are autoloaded. Invoking
-=jinx-correct= corrects the misspellings. Binding =jinx-correct= to =M-$= takes
-over that key from the default assignment to =ispell-word=. Since Jinx is
-independent of the Ispell package, =M-$= can be re-used.
+The commands =jinx-correct= and =jinx-languages= are marked as autoloads. 
Invoking
+=jinx-correct= corrects the misspellings. Binding =jinx-correct= to =M-$= 
takes over
+that key from the default assignment to =ispell-word=. Since Jinx is 
independent
+of the Ispell package, =M-$= can be re-used.
 
 #+begin_src emacs-lisp
 (keymap-global-set "M-$" #'jinx-correct)
@@ -80,7 +80,8 @@ independent of the Ispell package, =M-$= can be re-used.
 
 - =M-$= triggers correction for the misspelled word before point.
 - =C-u M-$= triggers correction for the entire buffer.
-- =C-u C-u M-$= forces correction of the word at point, even if it is not 
misspelled.
+- =C-u C-u M-$= forces correction of the word at point, even if it is not
+  misspelled.
 
 A sample configuration with the popular =use-package= macro is shown here:
 
diff --git a/jinx.el b/jinx.el
index 764cf7e293..face42aa59 100644
--- a/jinx.el
+++ b/jinx.el
@@ -903,8 +903,9 @@ Suggest corrections even if the word is not misspelled."
     (jinx--correct-guard
      (while (when-let ((skip (jinx--correct-overlay (make-overlay beg end) 
nil)))
               (forward-to-word skip)
-              (setf (cons beg end) (jinx--bounds-of-word))
-              beg)))))
+              (when-let ((bounds (jinx--bounds-of-word)))
+                (setf (cons beg end) bounds))
+              t)))))
 
 ;;;###autoload
 (defun jinx-correct (&optional arg)



reply via email to

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