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

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

[elpa] externals/jinx 6a72bb0c91 1/2: Minor simplification


From: ELPA Syncer
Subject: [elpa] externals/jinx 6a72bb0c91 1/2: Minor simplification
Date: Tue, 28 Mar 2023 17:58:44 -0400 (EDT)

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

    Minor simplification
---
 jinx.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/jinx.el b/jinx.el
index 078429779d..6d927d4817 100644
--- a/jinx.el
+++ b/jinx.el
@@ -642,7 +642,7 @@ If prefix argument ALL non-nil correct all misspellings."
   (interactive "*P")
   (unless jinx-mode (jinx-mode 1))
   (cl-letf (((symbol-function #'jinx--timer-handler) #'ignore) ;; Inhibit
-            (old-point (if all (push-mark) (point-marker))))
+            (old-point (and (not all) (point-marker))))
     (unwind-protect
         (if all
             (let* ((overlays (or (jinx--force-overlays (point-min) (point-max))
@@ -650,6 +650,7 @@ If prefix argument ALL non-nil correct all misspellings."
                    (nearest (jinx--nearest-overlay overlays))
                    (count (length overlays))
                    before after)
+              (push-mark)
               (dolist (ov overlays)
                 (if (or after (eq ov nearest))
                     (push ov after)
@@ -666,7 +667,7 @@ If prefix argument ALL non-nil correct all misspellings."
              (or (jinx--get-overlays (window-start) (window-end))
                  (jinx--force-overlays (window-start) (window-end))))
             (user-error "No misspelling in visible text"))))
-      (unless all (goto-char old-point))
+      (when old-point (goto-char old-point))
       (jit-lock-refontify))))
 
 ;;;###autoload



reply via email to

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