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#69516: 30.0.50; fontify newline and end of headlines in shr Date: Sun, 03 Mar 2024 08:56:16 +0200 Message-ID: <86y1azolbj.fsf@gnu.org> References: <87v864yzwk.fsf@strawberrytea.xyz> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34805"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69516@debbugs.gnu.org To: StrawberryTea Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 03 07:56:47 2024 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 1rgfmB-0008rF-6e for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Mar 2024 07:56:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgfm4-0002YO-FS; Sun, 03 Mar 2024 01:56:40 -0500 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 1rgfly-0002GG-EQ for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2024 01:56:37 -0500 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 1rgflx-0006xf-JM for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2024 01:56:33 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rgfmQ-0001Et-0F for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2024 01:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Mar 2024 06:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69516 X-GNU-PR-Package: emacs Original-Received: via spool by 69516-submit@debbugs.gnu.org id=B69516.17094490174747 (code B ref 69516); Sun, 03 Mar 2024 06:57:01 +0000 Original-Received: (at 69516) by debbugs.gnu.org; 3 Mar 2024 06:56:57 +0000 Original-Received: from localhost ([127.0.0.1]:39672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rgfmK-0001EU-VF for submit@debbugs.gnu.org; Sun, 03 Mar 2024 01:56:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rgfmI-0001E8-6f; Sun, 03 Mar 2024 01:56:56 -0500 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 1rgflj-0006wv-Tu; Sun, 03 Mar 2024 01:56:19 -0500 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=JBMp/+uperVwVQKTGY+EEcQWJRPsMkJCp+m6fuI14Jo=; b=S7NN9eN9jMlz BoNocUT8G+JefQzRO7H5Um4rBAfaUZn9EVHLEXxL31oLK2gztfjTp0A9prt98XXeyGCKEXcdmKeer hGONGJMMceiVF5LPgwW4dqbk/gJSJy1Q0DmZ144kVbqJrXrU4hAb65vKXHjC/vEn4CV63SG2NE7Zw yK7mbVxlDQ4nz+aE8oec9y/vSW8L8cO4OG5dt4+BZwzrM6wMOG5EbruehXuzFNgENdGHaFCONRQ9+ cSehHzoWlogmKV8rUCtSS2OC77FrMYa2AsfsYiEwxWFP49sAA4PROLR+iZGFjetXZGKUqCFfi6Uf3 QPnRJchJhzY14VitNVhEbA==; In-Reply-To: <87v864yzwk.fsf@strawberrytea.xyz> (message from StrawberryTea on Sat, 02 Mar 2024 17:31:07 -0600) 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:280921 Archived-At: severity 69516 wishlist thanks > From: StrawberryTea > Date: Sat, 02 Mar 2024 17:31:07 -0600 > > Hello Emacs developers, > > As you know, I love extending my headline backgrounds to the end of the > window. However, shr.el does not do this, understandably because shr.el > was written before the :extend keyword was added. > > The following patch hacks around this: > > modified lisp/net/shr.el > @@ -990,16 +990,21 @@ shr-fontize-dom > ;; Add face to the region, but avoid putting the font properties on > ;; blank text at the start of the line, and the newline at the end, to > ;; avoid ugliness. > (defun shr-add-font (start end type) > + (when (memq type '(shr-h1 shr-h2 shr-h3 shr-h4 shr-h5 shr-h6)) > + (insert "\n") > + (setq end (1+ end))) > (save-excursion > (goto-char start) > (while (< (point) end) > (when (bolp) > (skip-chars-forward " ")) > - (add-face-text-property (point) (min (line-end-position) end) type t) > + (add-face-text-property (point) end type t) > (if (< (line-end-position) end) > (forward-line 1) > (goto-char end))))) > > But this is a hack, and I would like to see a proper fix in Emacs. Thanks. Patches for this are welcome, but I think this should be an optional feature, given that we have lived without it for such a long time.