bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64126: [PATCH] New command 'eww-copy-alternate-url'


From: Eli Zaretskii
Subject: bug#64126: [PATCH] New command 'eww-copy-alternate-url'
Date: Sat, 17 Jun 2023 16:07:07 +0300

> Date: Sat, 17 Jun 2023 14:07:40 +0300
> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> This patch extends EWW with a command that grabs the URL of an alternate
> link of the current page, such as an RSS or Atom feed.

Thanks.

> This adds a new command to EWW that copies an alternate link to the
> currently visited page into the kill ring.  This is useful for
> subscribing to website feeds, etc..
                                   ^^
Two periods, one of which is probably redunant.

> +@findex eww-copy-alternate-url
> +@kindex A
> +  The @kbd{A} command (@code{eww-copy-alternate-url}) copies the URL
> +of an alternate link of the current page (such as an associated RSS
> +feed) into the kill ring.  If the page specifies multiple alternate
> +links, this command prompt for one of them in the minibuffer.

This doesn't say anything about what an "alternate link" could be, it
just provides a single example.  Since this is for the manual (as
opposed to the doc string), there's no need to be so terse; we should
instead explain more about what these alternate links are or could be,
and give more than just a single example.  Perhaps also tell how the
alternate links are designated in HTML.

> +*** New command 'eww-copy-alternate-url'.
> +It copies an alternate link to the page currently visited in EWW into
> +the kill ring.

Searching the Internet for "alternate link" brings this:

  A type of hyperlink that gives alternate representations of the
  current document.

Is this what is meant here?  If so, why are you talking about RSS
feeds?

> +(defun eww-read-alternate-url ()
> +  "Get the URL of an alternate link of this page.
> +
> +If there is just one alternate link, return it's URL.  If there
                                               ^^^^
"its"

> +are multiple alternate links, prompt for one in the minibuffer.

I guess the prompt is with completion?  If so, please mention that.

> +(defun eww-copy-alternate-url ()
> +  "Copy an alternate URL of the current page into the kill ring."

This doc string says nothing at all about what an alternate link is.
It should say at least something.

> +  (interactive nil eww-mode)
> +  (if-let ((url (eww-read-alternate-url)))
> +      (progn
> +        (kill-new url)
> +        (message "Copied %s to kill ring" url))
> +    (user-error "No feeds found!")))

"No feeds"?  Can the alternate link be something other than a feed?
In any case, "No feeds found on this page!" is better, I think, as "No
feeds!" is too general.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]