GNU bug report logs - #77961
31.0.50; Rendering HTML email is very slow since commit #eab14d68b2e72b9a6b8b0cc67c9667c2bfbed4f5

Previous Next

Package: emacs;

Reported by: Iñigo Serna <inigoserna <at> gmx.com>

Date: Mon, 21 Apr 2025 15:58:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: gerd.moellmann <at> gmail.com, rudalics <at> gmx.at, inigoserna <at> gmx.com, 77961 <at> debbugs.gnu.org
Subject: bug#77961: 31.0.50; Rendering HTML email is very slow since commit #eab14d68b2e72b9a6b8b0cc67c9667c2bfbed4f5
Date: Thu, 24 Apr 2025 08:13:25 +0300
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: martin rudalics <rudalics <at> gmx.at>, gerd.moellmann <at> gmail.com,
>  inigoserna <at> gmx.com, 77961 <at> debbugs.gnu.org
> Date: Wed, 23 Apr 2025 15:44:03 +0000
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >>    BEWARE: Most uses of this macro introduce bugs.
> >> 
> >> is much too mild in my opinion.  AFAICT the first two calls in shr.el
> >> could be avoided by using 'buffer-text-pixel-size'.  The one in
> >> 'shr-render-td-1' looks worse - since it calls 'shr-pixel-buffer-width'
> >> it nests one 'save-window-excursion' call into another which is simply
> >> evil.
> >
> > Thanks.  Patches welcome to avoid using save-window-excursion in
> > shr.el.
> 
> It is difficult until there is a clear picture why
> 
> (save-window-excursion
>           ;; Avoid errors if the selected window is a dedicated one,
>           ;; and they just want to insert a document into it.
>           (set-window-dedicated-p nil nil)
> 	  (set-window-buffer nil (current-buffer))
> 	  (car (window-text-pixel-size nil (line-beginning-position) (point))))
> 
> dance is even necessary.

Figuring that out is part of the job, AFAIU.  (We could try asking
Lars, if he remembers and if he will chime in.)

> For example, `string-pixel-width' somehow does not need it.

string-pixel-width didn't exist when this part of shr.el was
implemented.  And in addition, the fact that we still keep fixing
string-pixel-width so it does TRT in some complicated cases (the last
change was just a month ago), and its code becomes more and more
complex as result, is also telltale.




This bug report was last modified 27 days ago.

Previous Next


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