GNU bug report logs - #77299
eww-auto-rename-buffer 'title interaction with eww-readable-urls

Previous Next

Package: emacs;

Reported by: Keith Amidon <camalot <at> picnicpark.org>

Date: Thu, 27 Mar 2025 04:48:01 UTC

Severity: normal

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Keith Amidon <camalot <at> picnicpark.org>
Subject: bug#77299: closed (Re: bug#77299: eww-auto-rename-buffer 'title
 interaction with eww-readable-urls)
Date: Sun, 29 Jun 2025 17:11:05 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#77299: eww-auto-rename-buffer 'title interaction with eww-readable-urls

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 77299 <at> debbugs.gnu.org.

-- 
77299: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77299
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jim Porter <jporterbugs <at> gmail.com>
To: Keith Amidon <camalot <at> picnicpark.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 77299-done <at> debbugs.gnu.org
Subject: Re: bug#77299: eww-auto-rename-buffer 'title interaction with
 eww-readable-urls
Date: Sun, 29 Jun 2025 10:10:51 -0700
On 6/25/2025 9:36 PM, Jim Porter wrote:
> For the Emacs 30 branch, how about this? It just unconditionally renders 
> the full page first, which should be the least error-prone (at the cost 
> of some wasted CPU cycles).
> 
> However, in this version of the patch, we inhibit loading images when 
> temporarily rendering the full page. That way we don't *also* waste 
> network bandwidth.

I've now merged this latest patch to the Emacs 30 branch as db6cbee742f, 
so marking this bug as done. If I've missed anything, just let me know 
and I'll address it.

[Message part 3 (message/rfc822, inline)]
From: Keith Amidon <camalot <at> picnicpark.org>
To: bug-gnu-emacs <at> gnu.org
Subject: eww-auto-rename-buffer 'title interaction with eww-readable-urls
Date: Wed, 26 Mar 2025 11:04:49 -0700
I'm trying to use eww with:

(setq eww-auto-rename-buffer 'title
      eww-readable-urls '((".*" . t)))

I'm expecting that this will result in buffer names reflecting
the titles of the HTML pages. However, what I actually see is
that all buffers get named "Untitled # EWW", made unique by
uniquify.

This seems like a bug to me.

I believe it arises because the title element of eww-data is set
to the empty string by eww--before-browse and then set to the
actual title when shr-insert-document csiteslalls the eww-tag-title
function via the shr-external-rendering-functions set in
eww-display-document.

I think that in the readable case, the content passed to
shr-insert-document does not include the title element so
it isn't available from rendering that content.

It appears to me that eww-readable preserves the title
in the eww-data plist by resetting it after calling
eww-before-browse. And in fact, if I set eww-readable-urls to
nil and go to a site, the buffer is properly named based on
the title. If I then call eww-readable, it remains named
based on the title.

The default readability based-on eww-readable-urls appears
to happen in eww-display-html, which itself calls
eww-display-document. The full document hasn't been rendered
at this point so there is no existing title to preserve.

I don't think there is a simple fix for this. The fundamental
problem is that eww only gets the title by rendering the
original document and in the case of default readable URLs
it never renders the original document. I thought it might be
possible to hack eww-score-readability to include the title
in the readable version but it appears that it is omitting the
entire head section currently, so it would need fairly
extensive changes to selectively pass through the title
without any other head elements.

Help with this would be appreciated.  Thanks!  --- Keith




This bug report was last modified 22 days ago.

Previous Next


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