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

Full log


View this message in rfc822 format

From: Jim Porter <jporterbugs <at> gmail.com>
To: Keith Amidon <camalot <at> picnicpark.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 77299 <at> debbugs.gnu.org
Subject: bug#77299: eww-auto-rename-buffer 'title interaction with eww-readable-urls
Date: Tue, 17 Jun 2025 09:33:01 -0700
[Message part 1 (text/plain, inline)]
On 6/12/2025 9:47 AM, Keith Amidon wrote:
> If you have the time and interest to write the patch based on your 
> superior knowledge of the code Jim that would be great. I'm motivated to 
> have this work because I find using eww-readable-urls to make eww much 
> more useful for my day-to-day usage (thanks for contributing it!) but I 
> also heavily use org links which need the document title to work well.

It took a bit longer than I thought to do this, but after a few failed 
attempts, I think this patch is pretty close (aside from the couple of 
small FIXMEs in there).

As a bonus, this implementation is about 4x faster than the old one, 
since it does all the work in a single pass over the DOM. For large 
pages, simply computing the readable DOM can take a while; doing it for 
the Wikipedia page for "Sun" takes a full second. Here are the stats 
from calling the relevant code before and after (sum of 20 iterations):

  BEFORE:  20.635833s (15.510534s in 270 GCs)
  AFTER:    4.320405s (3.041672s in 55 GCs)

We could probably make this even faster by doing something more 
efficient than '(length (split-string FOO))', but one thing at a time. 
That's how the code was before, so I didn't change that bit.

> My current personal workaround is working but I'd like to get a solution 
> upstream and stop carrying it. If you come up with something you'd like 
> help testing I'd be happy to help with that. If you can't get to it for 
> a while I'll make time to poke at it.

If the attached changed is too risky for the release branch, I'm open to 
the idea of doing something like your workaround there, maybe only when 
'eww-auto-rename-buffer' is set to 'title'. That way, people without 
that setting don't suffer any performance penalty.
[0001-When-making-a-readable-page-in-EWW-include-the-title.patch (text/plain, attachment)]

This bug report was last modified today.

Previous Next


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