bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#58970: 29.0.50; Broken overlays order


From: Juri Linkov
Subject: bug#58970: 29.0.50; Broken overlays order
Date: Wed, 02 Nov 2022 19:47:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

After the merge of the noverlay branch, the order of overlays is reversed
in the return value of 'overlays-in'.  This broke at least flyspell.el
where flyspell-auto-correct-previous-word now changes an unexpected word
at the top of the buffer instead of fixing the last typed word.
This has a disastrous effect since these changes go unnoticed at the
beginning of the file.

This patch fixes at least flyspell.el, but no idea what other packages
are broken in the same way:

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index a66b72cfd06..11039f29630 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -2131,7 +2131,9 @@ flyspell-auto-correct-previous-word
          ;; 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]