GNU bug report logs - #49433
28.0.50; Faulty list of faces in shr-tag-h1

Previous Next

Package: emacs;

Reported by: Protesilaos Stavrou <info <at> protesilaos.com>

Date: Tue, 6 Jul 2021 07:38:01 UTC

Severity: normal

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49433 in the body.
You can then email your comments to 49433 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#49433; Package emacs. (Tue, 06 Jul 2021 07:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Protesilaos Stavrou <info <at> protesilaos.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 06 Jul 2021 07:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Faulty list of faces in shr-tag-h1
Date: Tue, 06 Jul 2021 10:37:12 +0300
In 'shr.el' we find these:

    (defun shr-tag-h1 (dom)
      (shr-heading dom (if shr-use-fonts
                   '(variable-pitch (:height 1.3 :weight bold))
                 'bold)))

    (defun shr-tag-h2 (dom)
      (shr-heading dom 'bold))

The intent is to make h1 headings use 'variable-pitch', however this
happens regardless, as can be noticed in other headings, such as h2 for
rendered documents.  As such, 'shr-tag-h1' creates duplication of the
'variable-pitch' entry.

Steps to reproduce on emacs -Q:

+ M-x eww RET https://www.gnu.org/software/emacs/

+ Go to the h1 heading that reads "GNU Emacs".

+ M-x describe-char

+ In the resulting Help buffer, notice this:

    (variable-pitch (variable-pitch (:height 1.3 :weight bold)))

+ The button that references that anonymous face does not provide a Help
  buffer with accurate information as to what attributes are in effect.
  Instead, it only lists the attributes of 'variable-pitch'.

+ Compare that to the information we get from the next heading, "An
  extensible, customizable, free/libre text editor — and more.", which
  accurately shows both of the faces that are in effect.

To fix the issue, we need to pass a face directly, without combining it
with 'variable-pitch'.  Just like 'shr-tag-h2'.  In a separate report, I
provide a patch that does that and adds new faces for all heading
elements (using 'defface' instead of hardcoding values).

Thank you!

-- 
Protesilaos Stavrou
https://protesilaos.com

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49433; Package emacs. (Tue, 06 Jul 2021 07:48:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; [PATCH] Add faces for shr heading elements (bug#49433)
Date: Tue, 06 Jul 2021 10:47:14 +0300
[Message part 1 (text/plain, inline)]
In bug#49433 I noted how shr-tag-h1 creates a faulty anonymous face that
users cannot inspect properly.  The attached patch fixes this issue and
also provides named faces for all shr heading levels from 1-6.

The attributes of those new faces are the same as before for
backward-compatibility in terms of visuals.

Thank you!

-- 
Protesilaos Stavrou
https://protesilaos.com
[0001-Add-faces-for-shr-heading-elements-bug-49433.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49433; Package emacs. (Tue, 06 Jul 2021 15:07:02 GMT) Full text and rfc822 format available.

Message #11 received at 49433 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: 49433 <at> debbugs.gnu.org
Subject: Re: bug#49433: 28.0.50; Faulty list of faces in shr-tag-h1
Date: Tue, 06 Jul 2021 17:06:41 +0200
Protesilaos Stavrou <info <at> protesilaos.com> writes:

> In bug#49433 I noted how shr-tag-h1 creates a faulty anonymous face that
> users cannot inspect properly.  The attached patch fixes this issue and
> also provides named faces for all shr heading levels from 1-6.
>
> The attributes of those new faces are the same as before for
> backward-compatibility in terms of visuals.

Thanks; applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 49433 <at> debbugs.gnu.org and Protesilaos Stavrou <info <at> protesilaos.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 06 Jul 2021 15:07:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 04 Aug 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 266 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.