GNU bug report logs - #77857
[PATCH] Let eww-copy-page-url append to existing kill

Previous Next

Package: emacs;

Reported by: James Thomas <jimjoe <at> gmx.net>

Date: Thu, 17 Apr 2025 04:39:01 UTC

Severity: wishlist

Tags: patch

To reply to this bug, email your comments to 77857 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#77857; Package emacs. (Thu, 17 Apr 2025 04:39:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to James Thomas <jimjoe <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 17 Apr 2025 04:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: James Thomas <jimjoe <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Let eww-copy-page-url append to existing kill
Date: Thu, 17 Apr 2025 10:07:52 +0530
[Message part 1 (text/plain, inline)]
Tags: patch
Severity: wishlist

[0001-Let-eww-copy-page-url-append-to-existing-kill.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
The way I use this, it lets me add the link to a description of the page
(usually text copied from itself) which is now fit for sharing with C-y.

Thoughts?

--

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77857; Package emacs. (Thu, 17 Apr 2025 05:53:02 GMT) Full text and rfc822 format available.

Message #8 received at 77857 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: James Thomas <jimjoe <at> gmx.net>, 77857 <at> debbugs.gnu.org
Subject: Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing kill
Date: Wed, 16 Apr 2025 22:52:12 -0700
James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> Tags: patch
> Severity: wishlist
>
> From c1f63607d0107c1ec39489bdcfdeb2c086112fbf Mon Sep 17 00:00:00 2001
> From: James Thomas <jimjoe <at> gmx.net>
> Date: Thu, 17 Apr 2025 09:56:27 +0530
> Subject: [PATCH] Let eww-copy-page-url append to existing kill
>
> * lisp/net/eww.el (eww-copy-page-url): Make the change.
> ---
>  lisp/net/eww.el | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/net/eww.el b/lisp/net/eww.el
> index c3e927b74a6..df16f12875a 100644
> --- a/lisp/net/eww.el
> +++ b/lisp/net/eww.el
> @@ -2159,7 +2159,10 @@ eww-copy-page-url
>    "Copy the URL of the current page into the kill ring."
>    (interactive nil eww-mode)
>    (message "%s" (plist-get eww-data :url))
> -  (kill-new (plist-get eww-data :url)))
> +  (let ((str (plist-get eww-data :url)))
> +    (if (eq last-command 'kill-region)
> +        (kill-append str nil)
> +      (kill-new str))))
>
>  (defun eww-download ()
>    "Download a Web page to `eww-download-directory'.
> --
> 2.46.0
>
>
> The way I use this, it lets me add the link to a description of the page
> (usually text copied from itself) which is now fit for sharing with C-y.
>
> Thoughts?

Makes sense to me, but I think we should make it optional somehow.  It's
not the typical use case, and it changes current behavior.  Perhaps a
new defcustom is in order.

This should also be in NEWS, and possibly in the EWW manual.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77857; Package emacs. (Thu, 17 Apr 2025 06:48:01 GMT) Full text and rfc822 format available.

Message #11 received at 77857 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: James Thomas <jimjoe <at> gmx.net>
Cc: 77857 <at> debbugs.gnu.org
Subject: Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing kill
Date: Thu, 17 Apr 2025 09:47:33 +0300
> Date: Thu, 17 Apr 2025 10:07:52 +0530
> From:  James Thomas via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> The way I use this, it lets me add the link to a description of the page
> (usually text copied from itself) which is now fit for sharing with C-y.
> 
> Thoughts?

That's an incompatible change in behavior, no?

In any case, it needs to be called out in NEWS.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77857; Package emacs. (Sat, 19 Apr 2025 09:25:02 GMT) Full text and rfc822 format available.

Message #14 received at 77857 <at> debbugs.gnu.org (full text, mbox):

From: James Thomas <jimjoe <at> gmx.net>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 77857 <at> debbugs.gnu.org
Subject: Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing
 kill, Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing kill
Date: Sat, 19 Apr 2025 14:54:27 +0530
Stefan Kangas writes:

> Makes sense to me, but I think we should make it optional somehow.  It's
> not the typical use case, and it changes current behavior.

Eli Zaretskii writes:

> That's an incompatible change in behavior, no?

Well... no (isn't it?). It only happens with 'C-M-w' before 'w', which
currently has no effect: (info "(emacs) Appending Kills").

--




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77857; Package emacs. (Sat, 19 Apr 2025 11:49:02 GMT) Full text and rfc822 format available.

Message #17 received at 77857 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: James Thomas <jimjoe <at> gmx.net>
Cc: stefankangas <at> gmail.com, 77857 <at> debbugs.gnu.org
Subject: Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing
 kill, Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing kill
Date: Sat, 19 Apr 2025 14:48:39 +0300
> From: James Thomas <jimjoe <at> gmx.net>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  77857 <at> debbugs.gnu.org
> Date: Sat, 19 Apr 2025 14:54:27 +0530
> 
> Stefan Kangas writes:
> 
> > Makes sense to me, but I think we should make it optional somehow.  It's
> > not the typical use case, and it changes current behavior.
> 
> Eli Zaretskii writes:
> 
> > That's an incompatible change in behavior, no?
> 
> Well... no (isn't it?). It only happens with 'C-M-w' before 'w', which
> currently has no effect: (info "(emacs) Appending Kills").

That's the change: previously Emacs produced different results in this
case.  People might not expect the 'w' command to do that, they might
expect that their previous kill remains intact.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77857; Package emacs. (Sun, 20 Apr 2025 07:01:02 GMT) Full text and rfc822 format available.

Message #20 received at 77857 <at> debbugs.gnu.org (full text, mbox):

From: James Thomas <jimjoe <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefankangas <at> gmail.com, 77857 <at> debbugs.gnu.org
Subject: Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing
 kill, Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing kill
Date: Sun, 20 Apr 2025 12:29:39 +0530
Eli Zaretskii writes:

>> From: James Thomas
>> Cc: Eli Zaretskii,  77857 <at> debbugs.gnu.org
>> Date: Sat, 19 Apr 2025 14:54:27 +0530
>> 
>> Stefan Kangas writes:
>> 
>> > Makes sense to me, but I think we should make it optional somehow.  It's
>> > not the typical use case, and it changes current behavior.
>> 
>> Eli Zaretskii writes:
>> 
>> > That's an incompatible change in behavior, no?
>> 
>> Well... no (isn't it?). It only happens with 'C-M-w' before 'w', which
>> currently has no effect: (info "(emacs) Appending Kills").
>
> That's the change: previously Emacs produced different results in this
> case.  People might not expect the 'w' command to do that, they might
> expect that their previous kill remains intact.

No, I mean, they'd _have_ to press 'C-M-w' for that to happen, right
before the 'w' - which they'd do only if they wanted this.

I think we're miscommunicating:

  Previously: C-M-w w: A simple copy (so no one would type the C-M-w).
  Now:        C-M-w w: Appended to the previous kill.

(There's no change in 'w's behaviour without an immediately preceding
'C-M-w')

--




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77857; Package emacs. (Sun, 20 Apr 2025 07:15:01 GMT) Full text and rfc822 format available.

Message #23 received at 77857 <at> debbugs.gnu.org (full text, mbox):

From: James Thomas <jimjoe <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefankangas <at> gmail.com, 77857 <at> debbugs.gnu.org
Subject: Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing
 kill, Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing kill
Date: Sun, 20 Apr 2025 12:43:10 +0530
James Thomas writes:

> Eli Zaretskii writes:
>
>>> From: James Thomas
>>> Cc: Eli Zaretskii,  77857 <at> debbugs.gnu.org
>>> Date: Sat, 19 Apr 2025 14:54:27 +0530
>>> 
>>> Stefan Kangas writes:
>>> 
>>> > Makes sense to me, but I think we should make it optional somehow.  It's
>>> > not the typical use case, and it changes current behavior.
>>> 
>>> Eli Zaretskii writes:
>>> 
>>> > That's an incompatible change in behavior, no?
>>> 
>>> Well... no (isn't it?). It only happens with 'C-M-w' before 'w', which
>>> currently has no effect: (info "(emacs) Appending Kills").
>>
>> That's the change: previously Emacs produced different results in this
>> case.  People might not expect the 'w' command to do that, they might
>> expect that their previous kill remains intact.
>
> No, I mean, they'd _have_ to press 'C-M-w' for that to happen, right
> before the 'w' - which they'd do only if they wanted this.
>
> I think we're miscommunicating:
>
>   Previously: C-M-w w: A simple copy (so no one would type the C-M-w).
>   Now:        C-M-w w: Appended to the previous kill.
>
> (There's no change in 'w's behaviour without an immediately preceding
> 'C-M-w')

Okay, I think I see what you mean: Are you talking about a 'C-w' on form
field text? If so, the user will have to move out of the field before
typing 'w' again: So it'll never be 'last-command', no?

--




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77857; Package emacs. (Sun, 20 Apr 2025 09:27:01 GMT) Full text and rfc822 format available.

Message #26 received at 77857 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: James Thomas <jimjoe <at> gmx.net>
Cc: stefankangas <at> gmail.com, 77857 <at> debbugs.gnu.org
Subject: Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing
 kill, Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing kill
Date: Sun, 20 Apr 2025 12:26:33 +0300
> From: James Thomas <jimjoe <at> gmx.net>
> Cc: stefankangas <at> gmail.com,  77857 <at> debbugs.gnu.org
> Date: Sun, 20 Apr 2025 12:29:39 +0530
> 
> Eli Zaretskii writes:
> 
> >> From: James Thomas
> >> Cc: Eli Zaretskii,  77857 <at> debbugs.gnu.org
> >> Date: Sat, 19 Apr 2025 14:54:27 +0530
> >> 
> >> Stefan Kangas writes:
> >> 
> >> > Makes sense to me, but I think we should make it optional somehow.  It's
> >> > not the typical use case, and it changes current behavior.
> >> 
> >> Eli Zaretskii writes:
> >> 
> >> > That's an incompatible change in behavior, no?
> >> 
> >> Well... no (isn't it?). It only happens with 'C-M-w' before 'w', which
> >> currently has no effect: (info "(emacs) Appending Kills").
> >
> > That's the change: previously Emacs produced different results in this
> > case.  People might not expect the 'w' command to do that, they might
> > expect that their previous kill remains intact.
> 
> No, I mean, they'd _have_ to press 'C-M-w' for that to happen, right
> before the 'w' - which they'd do only if they wanted this.
> 
> I think we're miscommunicating:
> 
>   Previously: C-M-w w: A simple copy (so no one would type the C-M-w).
>   Now:        C-M-w w: Appended to the previous kill.
> 
> (There's no change in 'w's behaviour without an immediately preceding
> 'C-M-w')

What I have in mind is the sequence "M-w w" or "C-w w".  AFAIU,
previously, 'w' would start a new kill-ring entry, but with your
suggestion it will append to whatever C-w/M-w killed before it.
Right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77857; Package emacs. (Mon, 21 Apr 2025 00:14:03 GMT) Full text and rfc822 format available.

Message #29 received at 77857 <at> debbugs.gnu.org (full text, mbox):

From: James Thomas <jimjoe <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefankangas <at> gmail.com, 77857 <at> debbugs.gnu.org
Subject: Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing kill
Date: Mon, 21 Apr 2025 05:43:00 +0530
[Message part 1 (text/plain, inline)]
Eli Zaretskii writes:

>> From: James Thomas
>> Cc: stefankangas <at> gmail.com,  77857 <at> debbugs.gnu.org
>> Date: Sun, 20 Apr 2025 12:29:39 +0530
>> 
>> Eli Zaretskii writes:
>> 
>> >> From: James Thomas
>> >> Cc: Eli Zaretskii,  77857 <at> debbugs.gnu.org
>> >> Date: Sat, 19 Apr 2025 14:54:27 +0530
>> >> 
>> >> Stefan Kangas writes:
>> >> 
>> >> > Makes sense to me, but I think we should make it optional somehow.  It's
>> >> > not the typical use case, and it changes current behavior.
>> >> 
>> >> Eli Zaretskii writes:
>> >> 
>> >> > That's an incompatible change in behavior, no?
>> >> 
>> >> Well... no (isn't it?). It only happens with 'C-M-w' before 'w', which
>> >> currently has no effect: (info "(emacs) Appending Kills").
>> >
>> > That's the change: previously Emacs produced different results in this
>> > case.  People might not expect the 'w' command to do that, they might
>> > expect that their previous kill remains intact.
>> 
>> No, I mean, they'd _have_ to press 'C-M-w' for that to happen, right
>> before the 'w' - which they'd do only if they wanted this.
>> 
>> I think we're miscommunicating:
>> 
>>   Previously: C-M-w w: A simple copy (so no one would type the C-M-w).
>>   Now:        C-M-w w: Appended to the previous kill.
>> 
>> (There's no change in 'w's behaviour without an immediately preceding
>> 'C-M-w')
>
> What I have in mind is the sequence "M-w w" or "C-w w".  AFAIU,
> previously, 'w' would start a new kill-ring entry, but with your
> suggestion it will append to whatever C-w/M-w killed before it.
> Right?

The first wouldn't, because 'M-w' is not 'kill-region', and for the
second, one would have to _move out_ of the form field (where the 'C-w'
happened) before pressing 'w'.

But indeed, when I came up with this I hadn't thought of the situation
where 'w' is rebound to a key-chord, perhaps, so that it could be typed
immediately after, in the latter case above. So the question now is
whether it's even desirable in such a (IMO, rare) case. If so, here's an
updated patch with a News entry.

[0001-Let-eww-copy-page-url-append-to-existing-kill.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77857; Package emacs. (Mon, 21 Apr 2025 00:45:01 GMT) Full text and rfc822 format available.

Message #32 received at 77857 <at> debbugs.gnu.org (full text, mbox):

From: James Thomas <jimjoe <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefankangas <at> gmail.com, 77857 <at> debbugs.gnu.org
Subject: Re: bug#77857: [PATCH] Let eww-copy-page-url append to existing kill
Date: Mon, 21 Apr 2025 06:13:59 +0530
[Message part 1 (text/plain, inline)]
James Thomas writes:

> Eli Zaretskii writes:
>
>>> From: James Thomas
>>> Cc: stefankangas <at> gmail.com,  77857 <at> debbugs.gnu.org
>>> Date: Sun, 20 Apr 2025 12:29:39 +0530
>>> 
>>> Eli Zaretskii writes:
>>> 
>>> >> From: James Thomas
>>> >> Cc: Eli Zaretskii,  77857 <at> debbugs.gnu.org
>>> >> Date: Sat, 19 Apr 2025 14:54:27 +0530
>>> >> 
>>> >> Stefan Kangas writes:
>>> >> 
>>> >> > Makes sense to me, but I think we should make it optional somehow.  It's
>>> >> > not the typical use case, and it changes current behavior.
>>> >> 
>>> >> Eli Zaretskii writes:
>>> >> 
>>> >> > That's an incompatible change in behavior, no?
>>> >> 
>>> >> Well... no (isn't it?). It only happens with 'C-M-w' before 'w', which
>>> >> currently has no effect: (info "(emacs) Appending Kills").
>>> >
>>> > That's the change: previously Emacs produced different results in this
>>> > case.  People might not expect the 'w' command to do that, they might
>>> > expect that their previous kill remains intact.
>>> 
>>> No, I mean, they'd _have_ to press 'C-M-w' for that to happen, right
>>> before the 'w' - which they'd do only if they wanted this.
>>> 
>>> I think we're miscommunicating:
>>> 
>>>   Previously: C-M-w w: A simple copy (so no one would type the C-M-w).
>>>   Now:        C-M-w w: Appended to the previous kill.
>>> 
>>> (There's no change in 'w's behaviour without an immediately preceding
>>> 'C-M-w')
>>
>> What I have in mind is the sequence "M-w w" or "C-w w".  AFAIU,
>> previously, 'w' would start a new kill-ring entry, but with your
>> suggestion it will append to whatever C-w/M-w killed before it.
>> Right?
>
> The first wouldn't, because 'M-w' is not 'kill-region', and for the
> second, one would have to _move out_ of the form field (where the 'C-w'
> happened) before pressing 'w'.
>
> But indeed, when I came up with this I hadn't thought of the situation
> where 'w' is rebound to a key-chord, perhaps, so that it could be typed
> immediately after, in the latter case above. So the question now is
> whether it's even desirable in such a (IMO, rare) case. If so, here's an
> updated patch with a News entry.

Updated with doc fixes:

[0001-Let-eww-copy-page-url-append-to-proximate-kill.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--

This bug report was last modified 3 days ago.

Previous Next


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