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