>From b648822ac4e401984f967fdc2d78e177697089ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Sat, 8 Feb 2020 00:08:13 +0100 Subject: [PATCH] Introduce face for elements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default face overrides the attributes of every enclosing element. E.g. with foo bar baz, since shr applies 'default' top of 'shr-link', "bar" has neither a blue foreground nor an underline. * lisp/net/shr.el (shr-code): New face. (shr-tag-code): Use it. --- lisp/net/shr.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 241180d471..1215fbddd0 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -142,6 +142,10 @@ shr-strike-through "Face for elements." :version "24.1") +(defface shr-code '((t :inherit fixed-pitch)) + "Face for elements." + :version "27.1") + (defface shr-link '((t :inherit link)) "Face for link elements." @@ -1438,7 +1442,7 @@ shr-tag-u (shr-fontize-dom dom 'underline)) (defun shr-tag-code (dom) - (let ((shr-current-font 'default)) + (let ((shr-current-font 'shr-code)) (shr-generic dom))) (defun shr-tag-tt (dom) -- 2.20.1