From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#44448: Fwd: bug#44448: Date: Thu, 12 Aug 2021 15:44:34 +0300 Message-ID: <83wnoqde8d.fsf@gnu.org> References: <83y298dx56.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11048"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44448@debbugs.gnu.org To: Amai Kinono Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 12 14:46:21 2021 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 1mEA6H-0002gP-30 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Aug 2021 14:46:21 +0200 Original-Received: from localhost ([::1]:56048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEA6D-0003hN-R7 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Aug 2021 08:46:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEA5y-0003gZ-Vb for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 08:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEA5y-0006mK-OM for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 08:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mEA5y-00007L-Fg for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 08:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Aug 2021 12:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44448 X-GNU-PR-Package: emacs Original-Received: via spool by 44448-submit@debbugs.gnu.org id=B44448.1628772305368 (code B ref 44448); Thu, 12 Aug 2021 12:46:02 +0000 Original-Received: (at 44448) by debbugs.gnu.org; 12 Aug 2021 12:45:05 +0000 Original-Received: from localhost ([127.0.0.1]:37752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEA52-00005r-Ve for submit@debbugs.gnu.org; Thu, 12 Aug 2021 08:45:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEA4x-00004s-E2 for 44448@debbugs.gnu.org; Thu, 12 Aug 2021 08:45:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35700) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEA4s-0006K9-6b; Thu, 12 Aug 2021 08:44:54 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1185 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEA4r-0000HA-GR; Thu, 12 Aug 2021 08:44:54 -0400 In-Reply-To: (message from Amai Kinono on Wed, 11 Aug 2021 20:18:36 +0800) 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:211662 Archived-At: > From: Amai Kinono > Date: Wed, 11 Aug 2021 20:18:36 +0800 > > > Some code in paren.el probably moves point without unwind-protect, or > something like that. > > It's not. To answer you, I've created a new recipe that only moves overlay, and > triggers the problem: > > 1. emacs -Q > > 2. M-x find-library RET paren > > 3. M-x split-window-horizontally > > 4. Go to the bottom of the file > > 5. M-x read-only-mode to turn off read-only-mode so we can write things here. > Also M-x auto-save-mode to stop Emacs from auto saving it. > > 6. Paste and eval this: > > (defvar test-overlay (make-overlay (point-min) (1+ (point-min)))) > (overlay-put test-overlay 'face 'isearch) > (run-with-timer 0 0.05 (lambda () > (let ((beg (random 5))) > (move-overlay test-overlay beg (1+ beg))))) > (defvar test-overlay2 (make-overlay (1- (point-max)) (point-max))) > (overlay-put test-overlay2 'face 'isearch) > (run-with-timer 0 0.05 (lambda () > (let ((beg (- (point-max) (random 5)))) > (move-overlay test-overlay beg (1+ beg))))) > > Now we have 2 overlays dancing at the beginning and end of buffer. > > 7. Go to the end of ther buffer, holding C-g for several secs. You may need to > do this several times, but there are chances that the cursor goes to the > beginning of the buffer. Thanks. I see the cause of it: it's the :eval forms that we execute when we redisplay the mode line, as part of redisplaying a window. When more than one window displays the same buffer at different buffer positions, when Emacs redisplays a non-selected window, it temporarily moves point to the place where it is displayed in that non-selected window. If C-g is processed while those :eval forms run, with the buffer's point temporarily moved, you will see point in the selected window "inherit" the position of point from the other window showing the same buffer. As evidence, after this happens, you should be able to see this in *Messages*: Error during redisplay: (mode-line-default-help-echo #) signaled (quit) We could prevent this jumping of point in these cases by running the :eval forms in the mode line with inhibit-quit bound to t, but then it will be impossible to interrupt :eval forms that run amok for some reason, which is a real danger, since the mode-line format is very frequently customized to include more or less arbitrary Lisp. So I'm not sure that inhibiting quitting would be a good idea here: the cure could be worse than the disease. Ideas for fixing this are welcome.