unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Navajeeth <yvv0@proton.me>, Adam Porter <adam@alphapapa.net>
Cc: 68254@debbugs.gnu.org, eliz@gnu.org
Subject: bug#68254: EWW ‘readable’ by default
Date: Sun, 17 Mar 2024 22:44:05 -0700	[thread overview]
Message-ID: <46d7b310-0c0d-769b-3937-d5dbe28ac3b3@gmail.com> (raw)
In-Reply-To: <2MQKkzbUomaUaXnNZ-fBUQh16ART3ObpVaHqCDAjrbzQxg4fHmMh2jEeB5cRcfXQJq3p4XfRG9ho6Icykbdc10b8qOlXgeb5FGfgEUw1h10=@proton.me>

On 3/17/2024 10:17 PM, Navajeeth via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Thank you so much for the patch, @Jim! I dunno how to apply patches, but 
> I’ll learn and try yours out as soon as I can.

Even though I contribute to Emacs, I tend to use the latest proper 
release as my daily editor (so I'm using 29.2 now).[1] If I want to use 
a patch I wrote on an older release, I take the new version of all the 
relevant functions and then override the old ones using 'advice-add':

   (defun updated-eww-readable (&optional arg)
    ;; new implementation here
    )
   (advice-add 'eww-readable :override 'updated-eww-readable)

If the patch has merged to the master branch, I usually wrap that with 
'(when (< emacs-major-version 30) ...)' so that it doesn't do anything 
on the master builds, and also so I know to remove it when 30.1 comes 
out and I prune my init.el.

> I think a better way to go would be to have a /readability-off/ list for 
> the readability-minor-mode. In my experience, with the kind of sites I 
> open with EWW (textual sites without a lot of graphics or JavaScript), 
> the list of ones where ‘eww-readable’ doesn’t work is a lot smaller than 
> the ones where it does.

I was thinking about doing something like this. The list of regexps 
could include a way to say both "if this regexp matches, use readable 
mode" and "if this regexp matches, *don't* use readable mode". Then you 
could make the list look something like this:

  '(("^https://example.com/" . not-readable)
    ".*")

That would make every page except those from https://example.com use 
readable mode. I think that would be the most flexible for complex 
cases, while still being simple for the common case (a list of "plain" 
regexps for readable-mode pages). It would also make it easy to have 
most of a site (except for one section) use readable-mode.

[1] Mainly I just want to avoid having to worry about updating Emacs 
master and then ending up with a broken Emacs. Murphy's Law dictates 
that that will always occur at the worst possible time.





  reply	other threads:[~2024-03-18  5:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05  7:35 bug#68254: EWW ‘readable’ by default Navajeeth via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-05 11:52 ` Eli Zaretskii
     [not found]   ` <poNSnv1DQ7L71-FirbCx9nuQ8gqLlPGTIjDYk2pKo2_H3BPuJArYQ2ziQ4pyADSxHCY5cU40D6MUzRqBAZE3pEcFmnzFPD49xunpLyh1UqI=@proton.me>
2024-01-05 13:35     ` Eli Zaretskii
2024-03-17 19:24       ` Jim Porter
2024-03-18  4:32         ` Adam Porter
2024-03-18  5:17           ` Navajeeth via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-18  5:44             ` Jim Porter [this message]
2024-03-18  5:18           ` Jim Porter
2024-03-18 12:37         ` Eli Zaretskii
2024-03-19  0:00           ` Jim Porter
2024-03-21 10:51             ` Eli Zaretskii
2024-03-22  5:46               ` Jim Porter
2024-03-23  7:48                 ` Eli Zaretskii
2024-03-23 17:26                   ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46d7b310-0c0d-769b-3937-d5dbe28ac3b3@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=68254@debbugs.gnu.org \
    --cc=adam@alphapapa.net \
    --cc=eliz@gnu.org \
    --cc=yvv0@proton.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).