From 56a332187bfc30957130c3aafbb9c0c9eec97fc5 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Wed, 22 Apr 2020 10:07:21 -0400 Subject: [PATCH] Patch shr-add-font after loading shr --- emacs/init.org | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 38432b6..0049bab 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -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 if there is some non-link face already on the text. The fix: #+BEGIN_SRC emacs-lisp - (defun shr-add-font (start end type) - (save-excursion - (goto-char start) - (while (< (point) end) - (when (bolp) - (skip-chars-forward " ")) - ;; Remove the APPEND argument to add-face-text-property - ;; so the face ends up at the head of the face list - (add-face-text-property (point) (min (line-end-position) end) type) - (if (< (line-end-position) end) - (forward-line 1) - (goto-char end))))) + (with-eval-after-load 'shr + (defun shr-add-font (start end type) + (save-excursion + (goto-char start) + (while (< (point) end) + (when (bolp) + (skip-chars-forward " ")) + ;; Remove the APPEND argument to add-face-text-property + ;; so the face ends up at the head of the face list + (add-face-text-property (point) (min (line-end-position) end) type) + (if (< (line-end-position) end) + (forward-line 1) + (goto-char end)))))) #+END_SRC * w3m