emacs-diffs
[Top][All Lists]
Advanced

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

master 651bf0a999: Fix overlays order in Flyspell (bug#58970)


From: Juri Linkov
Subject: master 651bf0a999: Fix overlays order in Flyspell (bug#58970)
Date: Thu, 3 Nov 2022 13:36:14 -0400 (EDT)

branch: master
commit 651bf0a99923e5eff279e9f9649aaed3d2f05c71
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    Fix overlays order in Flyspell (bug#58970)
    
    Flyspell relies on the sorting order of overlays from 'overlays-in'
    that returned the overlays sorted by decreased 'overlay-start'.
    But after the recent merge of the noverlay branch, the order was reversed.
    So need to change the order back to the expected by Flyspell.
    
    * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-word):
    Sort overlays returned from 'overlays-in' descending by 'overlay-start'.
---
 lisp/textmodes/flyspell.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index a66b72cfd0..11039f2963 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -2131,7 +2131,9 @@ But don't look beyond what's visible on the screen."
          ;; only reset if a new overlay exists
          (setq flyspell-auto-correct-previous-pos nil)
 
-         (let ((overlay-list (overlays-in (point-min) position))
+         (let ((overlay-list (seq-sort-by
+                               #'overlay-start #'>
+                               (overlays-in (point-min) position)))
                (new-overlay 'dummy-value))
 
            ;; search for previous (new) flyspell overlay



reply via email to

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