unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58970: 29.0.50; Broken overlays order
@ 2022-11-02 17:47 Juri Linkov
  2022-11-03 17:36 ` Juri Linkov
  0 siblings, 1 reply; 2+ messages in thread
From: Juri Linkov @ 2022-11-02 17:47 UTC (permalink / raw)
  To: 58970

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: overlays-in.patch --]
[-- Type: text/x-diff, Size: 628 bytes --]

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#58970: 29.0.50; Broken overlays order
  2022-11-02 17:47 bug#58970: 29.0.50; Broken overlays order Juri Linkov
@ 2022-11-03 17:36 ` Juri Linkov
  0 siblings, 0 replies; 2+ messages in thread
From: Juri Linkov @ 2022-11-03 17:36 UTC (permalink / raw)
  To: 58970

close 58970 29.0.50
stop

> 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:

Now fixed overlays in flyspell.el, and closed.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-03 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 17:47 bug#58970: 29.0.50; Broken overlays order Juri Linkov
2022-11-03 17:36 ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).