From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#58970: 29.0.50; Broken overlays order Date: Wed, 02 Nov 2022 19:47:01 +0200 Organization: LINKOV.NET Message-ID: <86edulz1t6.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32056"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) To: 58970@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 02 18:52:29 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqHuf-00089K-16 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Nov 2022 18:52:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqHuF-00049Q-Mn; Wed, 02 Nov 2022 13:52:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqHuF-00049I-1x for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 13:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqHuE-0002MQ-Q2 for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 13:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqHuE-0005HB-KW for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 13:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Nov 2022 17:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58970 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166741151620265 (code B ref -1); Wed, 02 Nov 2022 17:52:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Nov 2022 17:51:56 +0000 Original-Received: from localhost ([127.0.0.1]:47137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqHu7-0005Gn-OP for submit@debbugs.gnu.org; Wed, 02 Nov 2022 13:51:55 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:47074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqHu5-0005Gf-QC for submit@debbugs.gnu.org; Wed, 02 Nov 2022 13:51:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqHu5-000488-LC for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 13:51:53 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqHu4-0002LU-8f for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 13:51:53 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id CB875240008 for ; Wed, 2 Nov 2022 17:51:49 +0000 (UTC) Received-SPF: pass client-ip=217.70.183.193; envelope-from=juri@linkov.net; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246882 Archived-At: --=-=-= Content-Type: text/plain 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=overlays-in.patch 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 --=-=-=--