GNU bug report logs -
#68254
EWW ‘readable’ by default
Previous Next
Reported by: Navajeeth <yvv0 <at> proton.me>
Date: Fri, 5 Jan 2024 07:37:02 UTC
Severity: minor
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #42 received at 68254 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 3/21/2024 3:51 AM, Eli Zaretskii wrote:
> Yes, tests would be good.
I've now added tests. (Good thing too, since I found a minor bug while
writing them!)
>> ++++
>> +*** 'eww-readable' now toggles display of the readable parts of a web page.
>> +When called interactively, 'eww-readable' toggles whether to display
>> +only the readable parts of a page or the full page. With a positive
>> +prefix argument, always display the readable parts, and with a zero or
>> +negative prefix, always display the full page.
>
> You say "toggles", but then "display". It is better to make the style
> consistent.
Fixed.
>> +(defun eww--parse-html-region (start end &optional encode)
>> + "Parse the HTML between START and END, returning the DOM as an S-expression.
>> +Use ENCODE to decode the region; if nil, decode as UTF-8.
>
> It is better to call the argument DECODE, not ENCODE.
I changed this to CODING-SYSTEM, since that's what
'decode-coding-region' calls the argument.
>> +@vindex eww-readable-urls
>> + If you want EWW to render a certain page in ``readable'' mode by
>> +default, you can add a regular expression matching its URL to
>> +@code{eww-readable-urls}. Each entry can either be a regular expression
>> +as a string or a cons cell of the form @code{(@var{regexp}
>> +. @var{readability})}. If @var{readability} is non-@code{nil}, this
> ^^
> Please use @w to prevent breaking long expressions between two lines.
> Also, please leave two spaces between sentences.
Thanks, both fixed. I never knew about @w.
>> +(defcustom eww-readable-urls nil
>> + "A list of regexps matching URLs to display in readable mode by default.
>> +Each element can be either a string regexp or a cons cell of the
>> +form (REGEXP . READABILITY). If READABILITY is non-nil, this behaves
>> +the same as the string form; otherwise, URLs matching REGEXP will never
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> What do you mean by "the same as the string form"? which string form?
I've tried to clarify this. By "string form", I meant the "string
regexp" mentioned previously; in my new patch, I describe that as "a
regular expression in string form".
[0001-Allow-toggling-readable-mode-in-EWW.patch (text/plain, attachment)]
[0002-Add-eww-readable-urls.patch (text/plain, attachment)]
This bug report was last modified 1 year and 137 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.