Patch shr-add-font after loading shr

This commit is contained in:
Jeremy Dormitzer 2020-04-22 10:07:21 -04:00
parent 3b7d86919a
commit 56a332187b

View File

@ -3818,18 +3818,19 @@ faces to the existing face-list, rather than prepending the shr
face. This means that e.g. links don't actually get rendered correctly face. This means that e.g. links don't actually get rendered correctly
if there is some non-link face already on the text. The fix: if there is some non-link face already on the text. The fix:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun shr-add-font (start end type) (with-eval-after-load 'shr
(save-excursion (defun shr-add-font (start end type)
(goto-char start) (save-excursion
(while (< (point) end) (goto-char start)
(when (bolp) (while (< (point) end)
(skip-chars-forward " ")) (when (bolp)
;; Remove the APPEND argument to add-face-text-property (skip-chars-forward " "))
;; so the face ends up at the head of the face list ;; Remove the APPEND argument to add-face-text-property
(add-face-text-property (point) (min (line-end-position) end) type) ;; so the face ends up at the head of the face list
(if (< (line-end-position) end) (add-face-text-property (point) (min (line-end-position) end) type)
(forward-line 1) (if (< (line-end-position) end)
(goto-char end))))) (forward-line 1)
(goto-char end))))))
#+END_SRC #+END_SRC
* w3m * w3m