From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: StrawberryTea Newsgroups: gmane.emacs.bugs Subject: bug#65896: 30.0.50; folding text with text properties prevents background from extending past the newline Date: Sat, 30 Sep 2023 17:55:27 -0500 Message-ID: <87msx3uum1.fsf@strawberrytea.xyz> 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> <83a5tfadpq.fsf@gnu.org> <87a5tfp74p.fsf@gmail.com> <86o7huvjrh.fsf@mail.linkov.net> <87o7hla1x4.fsf@gmail.com> <86o7hlghcu.fsf@mail.linkov.net> <87edig6b95.fsf@strawberrytea.xyz> <83sf6vai0i.fsf@gnu.org> 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="20668"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.10.7; emacs 30.0.50 Cc: yantar92@posteo.net, kevin.legouguec@gmail.com, 65896@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 01 01:10:10 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 1qmj62-0004lS-R9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Oct 2023 01:10:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qmj5n-0001I0-S4; Sat, 30 Sep 2023 19:09:47 -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 1qmj5m-0001HV-Q8 for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 19:09:46 -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 1qmj5m-0007I7-IH for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 19:09:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qmj62-00069t-4m for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 19:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: StrawberryTea Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2023 23:10:02 +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.169611536123587 (code B ref 65896); Sat, 30 Sep 2023 23:10:02 +0000 Original-Received: (at 65896) by debbugs.gnu.org; 30 Sep 2023 23:09:21 +0000 Original-Received: from localhost ([127.0.0.1]:59967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmj5M-00068N-EM for submit@debbugs.gnu.org; Sat, 30 Sep 2023 19:09:20 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:56951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmj5J-000688-E8 for 65896@debbugs.gnu.org; Sat, 30 Sep 2023 19:09:18 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id A2E9B5C017D; Sat, 30 Sep 2023 19:08:56 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 30 Sep 2023 19:08:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= strawberrytea.xyz; h=cc:cc:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1696115336; x=1696201736; bh=Uve72lMsmT5IdwZyl9+scKuHV0AN/gt9w4U eRaqq7CQ=; b=Jz2pINfQQ9T4erqxR+w+dHjtpgySpYEFEADNhgFj2VhDGSEKzB2 u2lWsdhi+tBOjkVIQILWWp8+X0D+2KSOLWLx8JsIADdDCwplftMui+zCpyvNXT/A rKMiXWWU+PSwhqQLDlpQ9Ks3dUWAHGiZBZBGiAwEuNztwK+S8t2asrSA/cSDQbf1 bCyuY+MOljPRkuE1qlZaNphaQs1MjIv2vz2aZbZ8bznKkx2b4GLuJRQbcCQ0A8Ea Bh9y9WXhvA7xvGVFO18GVnqURqUhoakTUYkQ67OvX0NqBjfBDGHhxUT4z0OcJQoH rLfZO3MTYES5uKXQ1KSRagD56xGOay06Gsg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1696115336; x=1696201736; bh=Uve72lMsmT5Id wZyl9+scKuHV0AN/gt9w4UeRaqq7CQ=; b=IyFJfXZxu72PF1Pl5kbd1mSb5KJS2 DKhIpNtShXpgH4UfZagJ01xHzCVx55dtZA4n6pk4y17jWKKR/n+qvWgPowERFmBK 1WBdnAQhx1GCB1jnz3ZG8Lt1/CtclYuD+kczyulVKz9yvVqyG+tYg7AmUY/qKqBY oyGaVU+ugKc+GTUARYvrzXmh31h7NkyLxt897HHKSPHcf90UNbJgs1DrmOJGFYBe K0ZfA2WylNY+Oiaw1vi50JXnCiqQygK1WmBCZtdoRz2rXMbTmuhvKBLe4Qrpv/Mk RQ2QuCMSLVhSMlfhZvtVZYvxA6z5RPl7DGG4m3mAOaaXw6Ny5WnO0ML+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeggddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculddugedmnecujfgurhephffvvefuffhffggjkfggtgesmhdtreertder jeenucfhrhhomhepufhtrhgrfigsvghrrhihvfgvrgcuoehlohhokhesshhtrhgrfigsvg hrrhihthgvrgdrgiihiieqnecuggftrfgrthhtvghrnheptdegveetheehueevhffggeev ledtteduleehteetfeelledthfetteelhfelheetnecuffhomhgrihhnpehprghsthgvsg horghrugdrtghonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomheplhhoohhksehsthhrrgifsggvrhhrhihtvggrrdighiii X-ME-Proxy: Feedback-ID: id85149b6:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 30 Sep 2023 19:08:55 -0400 (EDT) In-reply-to: <83sf6vai0i.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: , 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:271567 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Basically, I want to be able to do this in Org mode: So I want a way to extend the heading background even when the heading is folded. Currently this works when there are no nested headings: (advice-add #=E2=80=99org-fold-core-region :around #=E2=80=99cae-org-fold-r= egion-a) (defun cae-org-fold-region-a (oldfun from to flag &optional spec-or-alias) (let ((shift-fold-p (and (eq to (point-max)) (not (eq from to)) flag))) (when shift-fold-p (setq to (1- to))) (funcall oldfun from to flag spec-or-alias) (remove-overlays from (1+ to) =E2=80=99cae-org-fold-heading t) (when flag (let ((o (make-overlay to (1+ to) nil =E2=80=99front-advance))) (overlay-put o =E2=80=99evaporate t) (overlay-put o =E2=80=99cae-org-fold-heading t) (overlay-put o =E2=80=99face (save-excursion (goto-char from) (face= -at-point))) (when shift-fold-p (overlay-put o =E2=80=99display =E2=80=9C\n=E2=80=9D)))))) Basically, when the text is folded, it uses the face of the first visible newline after the fold to determine the background. The elisp approach is to maintain overlays at the end of each folded region= and it becomes complicated with nested headings. I was thinking that instead, we could have the extend property (or an extra option on :extend) be used with= in the line to colorize the background of the newline at the end. Eli Zaretskii writes: >> From: StrawberryTea >> Cc: K=C3=A9vin Le Gouguec , Eli >> Zaretskii >> , 65896@debbugs.gnu.org, Ihor Radchenko >> >> Date: Fri, 29 Sep 2023 14:07:17 -0500 >> >> Basically, it=E2=80=99s always possible to overlay the newline after a f= old or shorten >> the fold by one character and overlay a newline for the last character t= hen set >> a face and extend property for that newline. > > Sorry, I don=E2=80=99t think I follow. Could you please show some exampl= e of > this, perhaps with =E2=80=9CASCII art=E2=80=9D? What do you mean by =E2= =80=9Coverlay the > newline=E2=80=9D, and what is =E2=80=9Cthe fold=E2=80=9D in this context? > >> What I think could be an alternative to adding all these overlays is a c= hange on >> the display engine side so that the extend property on a character exten= ds its >> face background regardless of whether it=E2=80=99s a newline character. > > That is a non-starter, since there=E2=80=99s no text in that part. We do= n=E2=80=99t > show any parts of the text area with any face unless that part is =E2=80= =9Cin > the middle of text=E2=80=9D, and the part after EOB isn=E2=80=99t. --=-=-=--