From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#58793: 28.1.90; Emacs tries to recenter / rescroll when it hits hidden org emphasis Date: Sat, 29 Oct 2022 02:42:13 +0000 Message-ID: <87h6znl5a2.fsf@localhost> References: <87a65jow19.fsf@localhost> <838rl1mmu4.fsf@gnu.org> <877d0kmvzu.fsf@localhost> <83tu3ojvb9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23013"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58793-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 29 04:42:17 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 1oobnc-0005oB-Tx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Oct 2022 04:42:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oobnQ-0001tu-IR; Fri, 28 Oct 2022 22:42:04 -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 1oobnP-0001td-1s for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 22:42: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 1oobnO-00009w-Qp for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 22:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oobnO-0002o6-Bs for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 22:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Oct 2022 02:42: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.166701130210760 (code D ref 58793); Sat, 29 Oct 2022 02:42:02 +0000 Original-Received: (at 58793-done) by debbugs.gnu.org; 29 Oct 2022 02:41:42 +0000 Original-Received: from localhost ([127.0.0.1]:34670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oobn4-0002nT-Ag for submit@debbugs.gnu.org; Fri, 28 Oct 2022 22:41:42 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:38529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oobmz-0002nD-Bf for 58793-done@debbugs.gnu.org; Fri, 28 Oct 2022 22:41:40 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9C73C240026 for <58793-done@debbugs.gnu.org>; Sat, 29 Oct 2022 04:41:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667011291; bh=ZStFhIIowr6PsHEgeP8ifa61CMX4u592ExkihHIAqDQ=; h=From:To:Cc:Subject:Date:From; b=qR7r65kyJgAFlQWeN7NXuPj3dOH8o9a9CgFcIRVESgakayG1CWxu84sZgcmJMI4gM B65LsU6aXdFl0HkrnVRV+Iw4mBTQcW07g1ZXUOuFbDZz87RihAzv3txBSBl8ccA6ro d0yLzr2JdNt0+QXAG6YWVOhw+e+EeyX61DN4+9pa5KCJ0/63rgG0f6aAK8Rxkd26Wo 7KWzPQP/G82Y9LhbMWs3tfAxczMbXdncNVw3N9xeQWzp8yTQB7efEyVIrXtdWGXT16 lG6phqihROt1TY9xddeIzz9WN+ZsC4BtaCW+dOKyPCnPKMuSWFxYXlbCb5aImOKtIg 9Auwlh7JqPVXg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MzkFQ2VCnz6trB; Sat, 29 Oct 2022 04:41:29 +0200 (CEST) In-Reply-To: <83tu3ojvb9.fsf@gnu.org> 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:246476 Archived-At: Eli Zaretskii writes: > 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. Thanks for the explanation! AFAIU, there is no way to avoid this and also use invisible text somewhere not at bol/eol. The best we can do is minimizing the chance to trigger this redisplay behaviour. > 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. Noted. Though I feel that we really need to have A LOT of invisible text to hit the issue frequently. (here, I was just digging through old bug reports in Org mailing list; it is not something people often complain about) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at