bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69516: 30.0.50; fontify newline and end of headlines in shr


From: StrawberryTea
Subject: bug#69516: 30.0.50; fontify newline and end of headlines in shr
Date: Sat, 02 Mar 2024 17:31:07 -0600
User-agent: mu4e 1.12.0; emacs 30.0.50

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 via email to

[Prev in Thread] Current Thread [Next in Thread]