all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: StrawberryTea <look@strawberrytea.xyz>
To: 69516@debbugs.gnu.org
Subject: bug#69516: 30.0.50; fontify newline and end of headlines in shr
Date: Sat, 02 Mar 2024 17:31:07 -0600	[thread overview]
Message-ID: <87v864yzwk.fsf@strawberrytea.xyz> (raw)

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.

StrawberryTea





             reply	other threads:[~2024-03-02 23:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02 23:31 StrawberryTea [this message]
     [not found] ` <handler.69516.B.170942231022491.ack@debbugs.gnu.org>
2024-03-03  4:02   ` bug#69516: Acknowledgement (30.0.50; fontify newline and end of headlines in shr) StrawberryTea
2024-03-03  6:56 ` bug#69516: 30.0.50; fontify newline and end of headlines in shr Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v864yzwk.fsf@strawberrytea.xyz \
    --to=look@strawberrytea.xyz \
    --cc=69516@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.