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#65896: 30.0.50; folding text with text properties prevents background from extending past the newline Date: Thu, 21 Sep 2023 14:07:39 +0300 Message-ID: <83bkdvaio4.fsf@gnu.org> References: <87ttrzmfua.fsf@strawberrytea.xyz> <83v8cfns1m.fsf@gnu.org> <87il8fm7x2.fsf@gmail.com> <40b4f4d3-34ae-4631-bebd-eefcd034d87e@app.fastmail.com> <83il8envaf.fsf@gnu.org> <87pm2d6mbj.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22752"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65896@debbugs.gnu.org, kevin.legouguec@gmail.com, look@strawberrytea.xyz To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 21 14:53:35 2023 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 1qjJBX-0005nW-I9 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Sep 2023 14:53:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjJ1M-0007s6-5p; Thu, 21 Sep 2023 08:43: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 1qjIzF-0005Un-TG for bug-gnu-emacs@gnu.org; Thu, 21 Sep 2023 08:40:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qjIzE-0001hG-5l for bug-gnu-emacs@gnu.org; Thu, 21 Sep 2023 08:40:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qjIzN-0003Ry-RE for bug-gnu-emacs@gnu.org; Thu, 21 Sep 2023 08:41:01 -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, 21 Sep 2023 12:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65896 X-GNU-PR-Package: emacs Original-Received: via spool by 65896-submit@debbugs.gnu.org id=B65896.169530005313237 (code B ref 65896); Thu, 21 Sep 2023 12:41:01 +0000 Original-Received: (at 65896) by debbugs.gnu.org; 21 Sep 2023 12:40:53 +0000 Original-Received: from localhost ([127.0.0.1]:32922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjIzE-0003RQ-Pb for submit@debbugs.gnu.org; Thu, 21 Sep 2023 08:40:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjIz5-0003Qy-D6 for 65896@debbugs.gnu.org; Thu, 21 Sep 2023 08:40:51 -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 1qjIyc-0000Nu-F4; Thu, 21 Sep 2023 08:40:15 -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=Lfzkg9StDWlqQKpn8JMG4VGrxOiFWcMIxhWf2mLPmyw=; b=O1QCoHENzmai Fku//LNXO60QQhuaVAKlPP41FxGaJrhFB0T7prmI2cfy3fda069MmMfr6bJ8NVptcMn191nwjAJnf InkqQ+J8RfY84l1S2X1d/qZ+Qs3kmPNkeuF5x0TnwFceKk0Q1y02an0u8NfcohiA8A4OS7nhN0IZ0 Z7+qZkeiJOlU1yoRweX18NA4EFpzi+IRKMkWUvbyRdtUKUInv5MHiwpp01+1blyXyinhsOdwr92lb cmd8gDs+BBbLZN9ZaqSu7boHzr15G1iKmKV1/FNEQ1BbZBrW1dGF6vNDUChnQ16jR/CFuoAazzZGQ v+yTPnFeWAFQWT/V5INf3g==; In-Reply-To: <87pm2d6mbj.fsf@localhost> (message from Ihor Radchenko on Wed, 20 Sep 2023 12:50:08 +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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270986 Archived-At: > From: Ihor Radchenko > Cc: LemonBreezes , 65896@debbugs.gnu.org, > kevin.legouguec@gmail.com > Date: Wed, 20 Sep 2023 12:50:08 +0000 > > Eli Zaretskii writes: > > >> This might not sound too clever, but why don't we just make the extend > >> property be determined by the first character in the line rather than > >> the last character / newline character? > > > > How can Emacs know, when it processes the first character on a line, > > whether the last character on that line will have the same face? > > > > You seem to assume that the Emacs display engine has "global" view of > > the line it is processing for display. But that's not what happens: > > the Emacs display is basically a one-pass layout engine whose view of > > the text is a peephole whose size is a single character. The display > > engine processes a character, makes all the decisions regarding its > > display and layout, then proceeds to the next one, and so on. When it > > gets to the newline that ends a line, it makes the decision whether > > the last face it saw needs to be extended, and if so, extends it. > > Are you sure? I am looking at `extend_face_to_end_of_line' and it looks > like there is nothing preventing it from accessing it->glyph_row->glyphs > array to look backwards into preceding glyphs. First, glyphs have only partial information about the original face properties. IOW, the produced glyph row doesn't have all the info that the original text had. And second, I don't see how the accessibility to the glyphs is relevant to the issue at hand. Suppose the visible text of a line is: aaabbbbxxx where each letter represents some character with different face -- you want Emacs to extend face 'a' after the end of the line, not the face 'x', just because the line started with characters whose face was 'a'?? that's what the OP said, AFAIU.