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#58793: 28.1.90; Emacs tries to recenter / rescroll when it hits hidden org emphasis Date: Fri, 28 Oct 2022 09:50:34 +0300 Message-ID: <83tu3ojvb9.fsf@gnu.org> References: <87a65jow19.fsf@localhost> <838rl1mmu4.fsf@gnu.org> <877d0kmvzu.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35046"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58793-done@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 28 08:51:54 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 1ooJDd-0008pv-7p for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Oct 2022 08:51:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooJCv-0003pi-33; Fri, 28 Oct 2022 02:51:09 -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 1ooJCq-0003lW-TX for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 02:51:05 -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 1ooJCp-0005TX-ME for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 02:51:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooJCo-00031A-Eq for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 02:51: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: Fri, 28 Oct 2022 06:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58793 X-GNU-PR-Package: emacs Original-Received: via spool by 58793-done@debbugs.gnu.org id=D58793.166693984911580 (code D ref 58793); Fri, 28 Oct 2022 06:51:02 +0000 Original-Received: (at 58793-done) by debbugs.gnu.org; 28 Oct 2022 06:50:49 +0000 Original-Received: from localhost ([127.0.0.1]:60097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooJCb-00030i-E6 for submit@debbugs.gnu.org; Fri, 28 Oct 2022 02:50:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooJCZ-00030T-Tr for 58793-done@debbugs.gnu.org; Fri, 28 Oct 2022 02:50:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooJCU-0005SW-Gh; Fri, 28 Oct 2022 02:50:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=nRUspDVsMd+99lNQcbJEBvpkf4dyfGUFu74XplsR6BY=; b=qz9U52B8AhHY fvlyxUnykG5dpa+H5XB8aOEvL1PTafhu0DU/k2nH1A7FRo8ggr6072sCOZ2x9Mf00f9XagDup2F9X GK86nnaDAlcLTr3eRlf987kuuRKEDohKOVIVeNKsplSLWgOFPmG2HggZWqqdEVWU1o9GX8YR8RVEu SJnRlP2h2wazwQjW/Fgcj6FggeihTrfhy61DE0ZjLhufZOWPi3NDajTXeQMI4Z8K9qPCYRnKbzp4P kimojq2G2JqZMguppSpift2T/xwrT/8G6hE937UBCdv09I06G6EU6f5C/IB2m2supNwjITXR7gvFa v7OLiai5t/rw2O7T6QQgug==; Original-Received: from [87.69.77.57] (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 1ooJCR-00018A-Hq; Fri, 28 Oct 2022 02:50:42 -0400 In-Reply-To: <877d0kmvzu.fsf@localhost> (message from Ihor Radchenko on Fri, 28 Oct 2022 04:07:33 +0000) 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:246396 Archived-At: > From: Ihor Radchenko > Cc: 58793@debbugs.gnu.org > Date: Fri, 28 Oct 2022 04:07:33 +0000 > > Eli Zaretskii writes: > > > Thanks, I hope I fixed this now. > > I confirm the fix. > Thanks! Thanks for testing, I'm therefore closing the bug. Btw, you wrote to the Org list that this issue has nothing to do with Org, but that is inaccurate. The bug was triggered by the fact that a screen line started with invisible text, and point was inside that invisible text. Emacs display code assumes in a lot of places that the position of point is somewhere between the positions of the first and the last glyph of a screen line which displays the cursor. Invisible text at the beginning or end of a screen line violates that assumption, if point is inside invisible text, because invisible text doesn't produce glyphs on the screen. Violating that assumption delivers a fatal blow to many redisplay optimizations that reuse previous display (instead of redrawing everything anew); one of such optimizations is for the situation when nothing's changed on display except that point moved. The display engine is still capable of dealing with such unusual situations, but it is likely to recenter the window in these cases, something that you find jarring. So by using invisible text too much, Org does risk triggering such situations more frequently. Since the result is not fatally wrong, just aesthetically annoying, I could say "wontfix", because fixing this is notoriously complicated, and risks introducing new exciting bugs (I hope I didn't introduce any this time). In this case I was lucky to be able to find a reasonable solution, but I cannot guarantee that for any similar issue in the future. After all, arguably Emacs just copes with the unusual situation by falling back on the only fail-safe redisplay mechanism we have. So it is not a bug, strictly speaking, just unusual and unexpected behavior. Please keep this in mind as you introduce features into Org and elsewhere which use invisible text.