unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: 58970@debbugs.gnu.org
Subject: bug#58970: 29.0.50; Broken overlays order
Date: Wed, 02 Nov 2022 19:47:01 +0200	[thread overview]
Message-ID: <86edulz1t6.fsf@mail.linkov.net> (raw)

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

             reply	other threads:[~2022-11-02 17:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 17:47 Juri Linkov [this message]
2022-11-03 17:36 ` bug#58970: 29.0.50; Broken overlays order Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86edulz1t6.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=58970@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).