* Re: recent change to yanking behavior of the clipboard
2022-02-06 7:37 ` Po Lu
@ 2022-02-06 9:20 ` Eli Zaretskii
2022-02-06 9:34 ` Po Lu
2022-02-06 10:18 ` Po Lu
` (3 subsequent siblings)
4 siblings, 1 reply; 38+ messages in thread
From: Eli Zaretskii @ 2022-02-06 9:20 UTC (permalink / raw)
To: Po Lu; +Cc: noah, emacs-devel
> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Sun, 06 Feb 2022 15:37:53 +0800
>
> > But, curiously, you didn't make this change for the primary selection.
>
> Because, typically, Emacs does not keep a local ring for text stored
> into the primary selection. `select-enable-primary' is a violation of
> the XDG clipboard spec, and is unlikely to be used by many people, so I
> didn't enable that code there.
How about enabling it for primary selections when
select-enable-primary is non-nil?
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-06 9:20 ` Eli Zaretskii
@ 2022-02-06 9:34 ` Po Lu
0 siblings, 0 replies; 38+ messages in thread
From: Po Lu @ 2022-02-06 9:34 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: noah, emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Po Lu <luangruo@yahoo.com>
>> Cc: emacs-devel@gnu.org
>> Date: Sun, 06 Feb 2022 15:37:53 +0800
>>
>> > But, curiously, you didn't make this change for the primary selection.
>>
>> Because, typically, Emacs does not keep a local ring for text stored
>> into the primary selection. `select-enable-primary' is a violation of
>> the XDG clipboard spec, and is unlikely to be used by many people, so I
>> didn't enable that code there.
>
> How about enabling it for primary selections when
> select-enable-primary is non-nil?
That could work too.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-06 7:37 ` Po Lu
2022-02-06 9:20 ` Eli Zaretskii
@ 2022-02-06 10:18 ` Po Lu
2022-02-06 16:09 ` Óscar Fuentes
` (2 subsequent siblings)
4 siblings, 0 replies; 38+ messages in thread
From: Po Lu @ 2022-02-06 10:18 UTC (permalink / raw)
To: Noah Friedman; +Cc: emacs-devel
Po Lu <luangruo@yahoo.com> writes:
> an interprogram paste, and text Lisp code saves into the kill ring is
^^^^^^^^^^^^^
I meant to say "CLIPBOARD".
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-06 7:37 ` Po Lu
2022-02-06 9:20 ` Eli Zaretskii
2022-02-06 10:18 ` Po Lu
@ 2022-02-06 16:09 ` Óscar Fuentes
2022-02-07 1:11 ` Po Lu
2022-02-06 22:39 ` Lars Ingebrigtsen
2022-02-07 1:11 ` recent change to yanking behavior of the clipboard Tim Cross
4 siblings, 1 reply; 38+ messages in thread
From: Óscar Fuentes @ 2022-02-06 16:09 UTC (permalink / raw)
To: emacs-devel
Po Lu <luangruo@yahoo.com> writes:
>> That means when I yank, I don't get the thing I've most recently copied to
>> the clipboard. I get some old thing from the primary selection.
>>
>> I don't understand how this new behavior is meant to be useful.
>
> It is meant to be useful by providing a visible performance improvement
> when Emacs is run over a network with moderate latency, by not querying
> the X server for the value of CLIPBOARD when text was last killed inside
> Emacs. And yes, that is what motivated me to install that change.
I have many hours of experience using Emacs through ADSL, 3G and even
EGPRS links with the NX protocol.
Can you show some numbers to quantify that visible performance
improvement? And an step-by-step procedure to demonstrate the
before/after difference?
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-06 16:09 ` Óscar Fuentes
@ 2022-02-07 1:11 ` Po Lu
2022-02-07 2:05 ` Óscar Fuentes
0 siblings, 1 reply; 38+ messages in thread
From: Po Lu @ 2022-02-07 1:11 UTC (permalink / raw)
To: Óscar Fuentes; +Cc: emacs-devel
Óscar Fuentes <ofv@wanadoo.es> writes:
> I have many hours of experience using Emacs through ADSL, 3G and even
> EGPRS links with the NX protocol.
>
> Can you show some numbers to quantify that visible performance
> improvement? And an step-by-step procedure to demonstrate the
> before/after difference?
Kill a large piece of text in Emacs 28, then C-y and enjoy the hang.
I didn't test with NX, just plain X11 over a network. Thanks.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 1:11 ` Po Lu
@ 2022-02-07 2:05 ` Óscar Fuentes
2022-02-07 2:59 ` Po Lu
0 siblings, 1 reply; 38+ messages in thread
From: Óscar Fuentes @ 2022-02-07 2:05 UTC (permalink / raw)
To: emacs-devel
Po Lu <luangruo@yahoo.com> writes:
> Óscar Fuentes <ofv@wanadoo.es> writes:
>
>> I have many hours of experience using Emacs through ADSL, 3G and even
>> EGPRS links with the NX protocol.
>>
>> Can you show some numbers to quantify that visible performance
>> improvement? And an step-by-step procedure to demonstrate the
>> before/after difference?
>
> Kill a large piece of text in Emacs 28, then C-y and enjoy the hang.
>
> I didn't test with NX, just plain X11 over a network. Thanks.
As a poor's man file synchronization system, I often copy entire buffer
contents (>1000 lines) from a remote session to a local Emacs, and
vice-versa. No problem.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 2:05 ` Óscar Fuentes
@ 2022-02-07 2:59 ` Po Lu
2022-02-07 5:04 ` Óscar Fuentes
0 siblings, 1 reply; 38+ messages in thread
From: Po Lu @ 2022-02-07 2:59 UTC (permalink / raw)
To: Óscar Fuentes; +Cc: emacs-devel
Óscar Fuentes <ofv@wanadoo.es> writes:
> As a poor's man file synchronization system, I often copy entire buffer
> contents (>1000 lines) from a remote session to a local Emacs, and
> vice-versa. No problem.
Over plain X, or some compression protocol?
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 2:59 ` Po Lu
@ 2022-02-07 5:04 ` Óscar Fuentes
2022-02-07 5:17 ` Yuri Khan
2022-02-07 5:31 ` Po Lu
0 siblings, 2 replies; 38+ messages in thread
From: Óscar Fuentes @ 2022-02-07 5:04 UTC (permalink / raw)
To: emacs-devel
Po Lu <luangruo@yahoo.com> writes:
> Óscar Fuentes <ofv@wanadoo.es> writes:
>
>> As a poor's man file synchronization system, I often copy entire buffer
>> contents (>1000 lines) from a remote session to a local Emacs, and
>> vice-versa. No problem.
>
> Over plain X, or some compression protocol?
Over NX, as mentioned previously.
BTW, if one feels that X is slow, using NX is a better course of action
than optimizing Emacs, IMAO. The difference is day and night.
X was not built for slow networks.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 5:04 ` Óscar Fuentes
@ 2022-02-07 5:17 ` Yuri Khan
2022-02-07 5:23 ` Óscar Fuentes
2022-02-07 5:31 ` Po Lu
1 sibling, 1 reply; 38+ messages in thread
From: Yuri Khan @ 2022-02-07 5:17 UTC (permalink / raw)
To: Óscar Fuentes; +Cc: Emacs developers
On Mon, 7 Feb 2022 at 12:08, Óscar Fuentes <ofv@wanadoo.es> wrote:
> >> As a poor's man file synchronization system, I often copy entire buffer
> >> contents (>1000 lines) from a remote session to a local Emacs, and
> >> vice-versa. No problem.
> >
> > Over plain X, or some compression protocol?
>
> Over NX, as mentioned previously.
>
> BTW, if one feels that X is slow, using NX is a better course of action
> than optimizing Emacs, IMAO. The difference is day and night.
Isn’t NX non-Free though?
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 5:04 ` Óscar Fuentes
2022-02-07 5:17 ` Yuri Khan
@ 2022-02-07 5:31 ` Po Lu
1 sibling, 0 replies; 38+ messages in thread
From: Po Lu @ 2022-02-07 5:31 UTC (permalink / raw)
To: emacs-devel
I have heard good things about NX, and these days it is free software. However, most people don't have a suitable client installed, while X comes with every desktop system in wide use today that can run the X version of Emacs.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-06 7:37 ` Po Lu
` (2 preceding siblings ...)
2022-02-06 16:09 ` Óscar Fuentes
@ 2022-02-06 22:39 ` Lars Ingebrigtsen
2022-02-07 1:12 ` Po Lu
2022-02-07 1:11 ` recent change to yanking behavior of the clipboard Tim Cross
4 siblings, 1 reply; 38+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-06 22:39 UTC (permalink / raw)
To: Po Lu; +Cc: Noah Friedman, emacs-devel
Po Lu <luangruo@yahoo.com> writes:
> Because, typically, Emacs does not keep a local ring for text stored
> into the primary selection. `select-enable-primary' is a violation of
> the XDG clipboard spec, and is unlikely to be used by many people, so I
> didn't enable that code there.
Enabling `select-enable-primary' is a common recommendation, so my guess
is that a lot of people have it enabled. (I have it enabled myself.)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-06 22:39 ` Lars Ingebrigtsen
@ 2022-02-07 1:12 ` Po Lu
2022-02-07 2:53 ` Lars Ingebrigtsen
0 siblings, 1 reply; 38+ messages in thread
From: Po Lu @ 2022-02-07 1:12 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Noah Friedman, emacs-devel
Lars Ingebrigtsen <larsi@gnus.org> writes:
>> Because, typically, Emacs does not keep a local ring for text stored
>> into the primary selection. `select-enable-primary' is a violation of
>> the XDG clipboard spec, and is unlikely to be used by many people, so I
>> didn't enable that code there.
> Enabling `select-enable-primary' is a common recommendation, so my guess
> is that a lot of people have it enabled. (I have it enabled myself.)
Doesn't that result in Emacs interfering with the primary selection of
other problems? And also other programs refusing to paste text killed
by Emacs?
Thanks.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 1:12 ` Po Lu
@ 2022-02-07 2:53 ` Lars Ingebrigtsen
2022-02-07 3:11 ` Po Lu
0 siblings, 1 reply; 38+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-07 2:53 UTC (permalink / raw)
To: Po Lu; +Cc: Noah Friedman, emacs-devel
Po Lu <luangruo@yahoo.com> writes:
>> Enabling `select-enable-primary' is a common recommendation, so my guess
>> is that a lot of people have it enabled. (I have it enabled myself.)
>
> Doesn't that result in Emacs interfering with the primary selection of
> other problems? And also other programs refusing to paste text killed
> by Emacs?
I'm not sure what you mean. When I kill text in Emacs (with `C-k' or
the like), I want to be able to paste it with mouse-2 in other programs,
if that's what you're getting at.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 2:53 ` Lars Ingebrigtsen
@ 2022-02-07 3:11 ` Po Lu
2022-02-07 3:41 ` Lars Ingebrigtsen
0 siblings, 1 reply; 38+ messages in thread
From: Po Lu @ 2022-02-07 3:11 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Noah Friedman, emacs-devel
Lars Ingebrigtsen <larsi@gnus.org> writes:
>> Doesn't that result in Emacs interfering with the primary selection of
>> other problems? And also other programs refusing to paste text killed
>> by Emacs?
> I'm not sure what you mean. When I kill text in Emacs (with `C-k' or
> the like), I want to be able to paste it with mouse-2 in other programs,
> if that's what you're getting at.
Text you cut from other programs will stop showing up in Emacs when you
press `C-y', since explicit paste commands are required to paste from
CLIPBOARD and not PRIMARY.
I think we save all text that gets killed into the primary selection
regardless of the value of `select-enable-primary'. If not, that's a
bug.
IOW, when you press C-k at the beginning of a line, Emacs sets the
contents of CLIPBOARD and PRIMARY (what you paste with the middle mouse
button) to the contents of the line.
Then, when you press C-y, Emacs is supposed to look for the value in
CLIPBOARD (and never PRIMARY).
That means the only valid combination is the default, which is to have
`select-enable-clipboard' set to t and `select-enable-primary' set to
nil.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 3:11 ` Po Lu
@ 2022-02-07 3:41 ` Lars Ingebrigtsen
2022-02-07 3:48 ` Po Lu
0 siblings, 1 reply; 38+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-07 3:41 UTC (permalink / raw)
To: Po Lu; +Cc: Noah Friedman, emacs-devel
Po Lu <luangruo@yahoo.com> writes:
> Then, when you press C-y, Emacs is supposed to look for the value in
> CLIPBOARD (and never PRIMARY).
>
> That means the only valid combination is the default, which is to have
> `select-enable-clipboard' set to t and `select-enable-primary' set to
> nil.
Again, I don't understand what you mean. I have
`select-enable-clipboard' set to nil and `select-enable-primary' and set
to t, and that's a valid combination -- it does what I want to, and has
done so for at least a decade.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 3:41 ` Lars Ingebrigtsen
@ 2022-02-07 3:48 ` Po Lu
2022-02-07 4:05 ` Lars Ingebrigtsen
` (2 more replies)
0 siblings, 3 replies; 38+ messages in thread
From: Po Lu @ 2022-02-07 3:48 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Noah Friedman, emacs-devel
Lars Ingebrigtsen <larsi@gnus.org> writes:
>> Then, when you press C-y, Emacs is supposed to look for the value in
>> CLIPBOARD (and never PRIMARY).
>>
>> That means the only valid combination is the default, which is to have
>> `select-enable-clipboard' set to t and `select-enable-primary' set to
>> nil.
> Again, I don't understand what you mean.
>
> I have `select-enable-clipboard' set to nil and
> `select-enable-primary' and set to t, and that's a valid combination
> -- it does what I want to, and has done so for at least a decade.
On X, every program is supposed to follow this:
https://specifications.freedesktop.org/clipboards-spec/clipboards-spec.txt
In short:
1. selecting but with no explicit copy should only set PRIMARY,
never CLIPBOARD
2. middle mouse button should paste PRIMARY, never CLIPBOARD
3. explicit cut/copy commands (i.e. menu items, toolbar buttons) should
always set CLIPBOARD to the currently-selected data (i.e.
conceptually copy PRIMARY to CLIPBOARD)
4. explicit cut/copy commands should always set both CLIPBOARD and
PRIMARY, even when copying doesn't involve a selection (e.g. a "copy
url" -option which explicitly copies an url without the url being
selected first)
5. explicit paste commands should paste CLIPBOARD, not PRIMARY
6. a selection becoming unselected should never unset PRIMARY
7. possibly contradicting the ICCCM, clients don't need to support
SECONDARY, though if anyone can figure out what it's good for they
should feel free to use it for that
8. cut buffers are evil; they only support ASCII, they don't work with
many clients, and they require data to be copied to the X
server. Therefore clients should avoid using cut buffers and use
only selections.
Setting `select-enable-clipboard' to nil violates 3, 4, and 5, while
setting `select-enable-primary' to t violates 5 and 4.
Thanks.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 3:48 ` Po Lu
@ 2022-02-07 4:05 ` Lars Ingebrigtsen
2022-02-07 4:44 ` Po Lu
2022-02-07 12:49 ` Eli Zaretskii
2022-02-07 13:14 ` Stefan Monnier
2 siblings, 1 reply; 38+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-07 4:05 UTC (permalink / raw)
To: Po Lu; +Cc: Noah Friedman, emacs-devel
Po Lu <luangruo@yahoo.com> writes:
> On X, every program is supposed to follow this:
>
> https://specifications.freedesktop.org/clipboards-spec/clipboards-spec.txt
I reject the premise that Emacs should be bound by design decisions made
by freedesktop.org.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 4:05 ` Lars Ingebrigtsen
@ 2022-02-07 4:44 ` Po Lu
2022-02-07 4:57 ` Corwin Brust
0 siblings, 1 reply; 38+ messages in thread
From: Po Lu @ 2022-02-07 4:44 UTC (permalink / raw)
To: emacs-devel, Lars Ingebrigtsen; +Cc: Noah Friedman
[-- Attachment #1: Type: text/plain, Size: 304 bytes --]
Our tail is not strong enough to wag the dog
that is the X window system. Other programs
have decided to follow the standardized behavior,
and the only result of us not following suit is that
we will no longer be able to run on the same X server
as any other modern client without causing problems.
[-- Attachment #2: Type: text/html, Size: 355 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 4:44 ` Po Lu
@ 2022-02-07 4:57 ` Corwin Brust
2022-02-07 5:29 ` Po Lu
0 siblings, 1 reply; 38+ messages in thread
From: Corwin Brust @ 2022-02-07 4:57 UTC (permalink / raw)
To: Po Lu; +Cc: Lars Ingebrigtsen, Noah Friedman, Emacs developers
On Sun, Feb 6, 2022 at 10:46 PM Po Lu <Luangruo@yahoo.com> wrote:
>
> Our tail is not strong enough to wag the dog
> that is the X window system. Other programs
> have decided to follow the standardized behavior,
> and the only result of us not following suit is that
> we will no longer be able to run on the same X server
> as any other modern client without causing problems.
FWIW, I don't think we are attempting to "wag the dog" here, in terms
of influencing the X foundation, so much as to prevent changes in the
behavior of Emacs that the users (at least, all who have chimed in
here excluding you who made this change and presumably like it)
prefer.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 4:57 ` Corwin Brust
@ 2022-02-07 5:29 ` Po Lu
2022-02-07 5:47 ` Corwin Brust
` (2 more replies)
0 siblings, 3 replies; 38+ messages in thread
From: Po Lu @ 2022-02-07 5:29 UTC (permalink / raw)
To: emacs-devel
>FWIW, I don't think we are attempting to "wag the dog" here, in terms
>of influencing the X foundation, so much as to prevent changes in the
>behavior of Emacs that the users (at least, all who have chimed in
>here excluding you who made this change and presumably like it)
>prefer.
FTR, I didn't make any change to which selection is used by default, and Noah is the only person who complained about the change that I did make.
I was trying to discourage users from enabling `select-enable-primary', which Lars disagreed with. It was turned off by default in Emacs 21, where Emacs switched to the now-standard behaviour by default.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 5:29 ` Po Lu
@ 2022-02-07 5:47 ` Corwin Brust
2022-02-07 5:52 ` tomas
2022-02-07 13:17 ` Eli Zaretskii
2 siblings, 0 replies; 38+ messages in thread
From: Corwin Brust @ 2022-02-07 5:47 UTC (permalink / raw)
To: Po Lu; +Cc: Emacs developers
On Sun, Feb 6, 2022 at 11:30 PM Po Lu <Luangruo@yahoo.com> wrote:
>
> >FWIW, I don't think we are attempting to "wag the dog" here, in terms
> >of influencing the X foundation, so much as to prevent changes in the
> >behavior of Emacs that the users (at least, all who have chimed in
> >here excluding you who made this change and presumably like it)
> >prefer.
>
> FTR, I didn't make any change to which selection is used by default, and Noah is the only person who complained about the change that I did make.
>
> I was trying to discourage users from enabling `select-enable-primary', which Lars disagreed with. It was turned off by default in Emacs 21, where Emacs switched to the now-standard behaviour by default.
I appreciate the clarification.
Thank you Po
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 5:29 ` Po Lu
2022-02-07 5:47 ` Corwin Brust
@ 2022-02-07 5:52 ` tomas
2022-02-07 6:43 ` Po Lu
2022-02-07 13:17 ` Eli Zaretskii
2 siblings, 1 reply; 38+ messages in thread
From: tomas @ 2022-02-07 5:52 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1226 bytes --]
On Mon, Feb 07, 2022 at 01:29:45PM +0800, Po Lu wrote:
> >FWIW, I don't think we are attempting to "wag the dog" here, in terms
> >of influencing the X foundation [...]
> FTR, I didn't make any change to which selection is used by default, and Noah is the only person who complained about the change that I did make.
>
> I was trying to discourage users from enabling `select-enable-primary', which Lars disagreed with. It was turned off by default in Emacs 21, where Emacs switched to the now-standard behaviour by default.
One of those default discussions, sigh :)
FWIW, I'm one of those having set `select-enable-primary' to t (after a
short period of swearing and trying to understand what happened).
I do understand the choice of the default. I'm happy and thankful that
there is a cop-out.
Psychologically it is extremely... challenging that something "stops
working" under you, and you don't even know how that something is
called. Perhaps that's part of the reason for the sometimes strong
reactions elicited by some changes.
I don't have a solution for that; IMHO Emacs is doing extremely well in
that department compared to other applications.
Thanks, folks.
Cheers
--
tomás
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 5:52 ` tomas
@ 2022-02-07 6:43 ` Po Lu
2022-02-07 6:57 ` tomas
0 siblings, 1 reply; 38+ messages in thread
From: Po Lu @ 2022-02-07 6:43 UTC (permalink / raw)
To: tomas; +Cc: emacs-devel
<tomas@tuxteam.de> writes:
>> I was trying to discourage users from enabling
>> `select-enable-primary', which Lars disagreed with. It was turned
>> off by default in Emacs 21, where Emacs switched to the now-standard
>> behaviour by default.
> One of those default discussions, sigh :)
None of us are questioning the default here, I was simply trying to
discourage people from doing that.
> FWIW, I'm one of those having set `select-enable-primary' to t (after a
> short period of swearing and trying to understand what happened).
>
> I do understand the choice of the default. I'm happy and thankful that
> there is a cop-out.
Now that the last holdouts (Qt) have dropped their options to even
revert to the old interpretation at all, I see no point in continuing to
set `select-enable-primary' to t, since all that accomplishes is to make
Emacs less interoperable with other programs.
If someone still wants to turn it on, nothing stops him from doing so.
However, the behaviour of his desktop will become undefined, and other
programs will stop working correctly.
Thanks.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 6:43 ` Po Lu
@ 2022-02-07 6:57 ` tomas
0 siblings, 0 replies; 38+ messages in thread
From: tomas @ 2022-02-07 6:57 UTC (permalink / raw)
To: Po Lu; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 874 bytes --]
On Mon, Feb 07, 2022 at 02:43:43PM +0800, Po Lu wrote:
> <tomas@tuxteam.de> writes:
>
> >> I was trying to discourage users from enabling
> >> `select-enable-primary', which Lars disagreed with. It was turned
> >> off by default in Emacs 21, where Emacs switched to the now-standard
> >> behaviour by default.
>
> > One of those default discussions, sigh :)
>
> None of us are questioning the default here, I was simply trying to
> discourage people from doing that.
I see. I do understand your points, mind you. Still...
> If someone still wants to turn it on, nothing stops him from doing so.
... I'm glad I can do that.
> However, the behaviour of his desktop will become undefined, and other
> programs will stop working correctly.
I choose wisely. And hate those outliers I /have/ to use nevertheless.
Yes, I'm weird :-)
Thanks
--
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 5:29 ` Po Lu
2022-02-07 5:47 ` Corwin Brust
2022-02-07 5:52 ` tomas
@ 2022-02-07 13:17 ` Eli Zaretskii
2022-02-07 13:18 ` Po Lu
2 siblings, 1 reply; 38+ messages in thread
From: Eli Zaretskii @ 2022-02-07 13:17 UTC (permalink / raw)
To: Po Lu; +Cc: emacs-devel
> Date: Mon, 07 Feb 2022 13:29:45 +0800
> From: Po Lu <Luangruo@yahoo.com>
>
> I was trying to discourage users from enabling `select-enable-primary', which Lars disagreed with. It was turned off by default in Emacs 21, where Emacs switched to the now-standard behaviour by default.
Not in Emacs 21, but in Emacs 24.1.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 13:17 ` Eli Zaretskii
@ 2022-02-07 13:18 ` Po Lu
0 siblings, 0 replies; 38+ messages in thread
From: Po Lu @ 2022-02-07 13:18 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Mon, 07 Feb 2022 13:29:45 +0800
>> From: Po Lu <Luangruo@yahoo.com>
>>
>> I was trying to discourage users from enabling
>> `select-enable-primary', which Lars disagreed with. It was turned
>> off by default in Emacs 21, where Emacs switched to the now-standard
>> behaviour by default.
>
> Not in Emacs 21, but in Emacs 24.1.
That's a typo, I missed that.
Thanks.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 3:48 ` Po Lu
2022-02-07 4:05 ` Lars Ingebrigtsen
@ 2022-02-07 12:49 ` Eli Zaretskii
2022-02-07 12:56 ` Po Lu
2022-02-07 13:14 ` Stefan Monnier
2 siblings, 1 reply; 38+ messages in thread
From: Eli Zaretskii @ 2022-02-07 12:49 UTC (permalink / raw)
To: Po Lu; +Cc: larsi, noah, emacs-devel
> From: Po Lu <luangruo@yahoo.com>
> Cc: Noah Friedman <noah@splode.com>, emacs-devel@gnu.org
> Date: Mon, 07 Feb 2022 11:48:45 +0800
>
> On X, every program is supposed to follow this:
>
> https://specifications.freedesktop.org/clipboards-spec/clipboards-spec.txt
These rules changed some time ago; previously, X applications behaved
differently (e.g., copy/paste used PRIMARY etc.). Emacs originally
behaved like the other X apps before the change. We then switched to
the new behavior in Emacs 24.1, to follow suit, but left behind user
options to allow users to get back the old behavior.
Since we didn't decide to drop the old behavior, I think we should
continue supporting it with the new features, at least as opt-in.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 12:49 ` Eli Zaretskii
@ 2022-02-07 12:56 ` Po Lu
0 siblings, 0 replies; 38+ messages in thread
From: Po Lu @ 2022-02-07 12:56 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: larsi, noah, emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> On X, every program is supposed to follow this:
>>
>> https://specifications.freedesktop.org/clipboards-spec/clipboards-spec.txt
> These rules changed some time ago; previously, X applications behaved
> differently (e.g., copy/paste used PRIMARY etc.).
The situation is more confusing than that; the previous X standards
document was ambiguously worded, so half the X applications interpreted
it as prefering the use of PRIMARY for copy/paste, and the other half
CLIPBOARD.
Eventually, people realized the former didn't make much sense, so most
of those programs adopted the latter interpretation. By the 2000s, the
only program still defaulting to PRIMARY was Emacs, and even we followed
suit with 24.1.
> Emacs originally behaved like the other X apps before the change. We
> then switched to the new behavior in Emacs 24.1, to follow suit, but
> left behind user options to allow users to get back the old behavior.
Yes.
> Since we didn't decide to drop the old behavior, I think we should
> continue supporting it with the new features, at least as opt-in.
It isn't really a new feature, just an optimization. Anyway, it doesn't
work with the primary selection, as `mouse-yank-primary' still complains
that no selection exists.
Thanks.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 3:48 ` Po Lu
2022-02-07 4:05 ` Lars Ingebrigtsen
2022-02-07 12:49 ` Eli Zaretskii
@ 2022-02-07 13:14 ` Stefan Monnier
2022-02-07 13:17 ` Po Lu
2 siblings, 1 reply; 38+ messages in thread
From: Stefan Monnier @ 2022-02-07 13:14 UTC (permalink / raw)
To: Po Lu; +Cc: Lars Ingebrigtsen, Noah Friedman, emacs-devel
> On X, every program is supposed to follow this:
>
> https://specifications.freedesktop.org/clipboards-spec/clipboards-spec.txt
>
> In short:
Some of those specs talk about interaction with other programs, in which
case we should arguably follow them to be good neighbors. But other
parts talk about the UI and only affect the contract between the
application and the user. We have no obligation to follow those parts,
tho of course it might make a lot of sense to make the default behavior
follow those specs to avoid surprising the user.
The change under discussion here was motivated by an optimization, so
presumably it should not affect the interface between the user and
Emacs, but only between Emacs and the system. So IIUC this is a part
where the spec is indeed very relevant and we should strive to
follow it. But I must say I don't know which part of the spec the
change is related to. Could you clarify?
> Setting `select-enable-clipboard' to nil violates 3, 4, and 5, while
> setting `select-enable-primary' to t violates 5 and 4.
These seem to only affect the contract between the user and Emacs, so if
the users change them to their default, that can only hurt themselves.
And AFAICT our default settings don't violate those parts 3, 4, and 5,
so we're fine.
And of course I still can't see in which way this relates to
commit 99c637499e.
Stefan
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 13:14 ` Stefan Monnier
@ 2022-02-07 13:17 ` Po Lu
2022-02-07 13:50 ` Don't change `select-enable-primary` (was: recent change to yanking behavior of the clipboard) Stefan Monnier
0 siblings, 1 reply; 38+ messages in thread
From: Po Lu @ 2022-02-07 13:17 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Lars Ingebrigtsen, Noah Friedman, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Some of those specs talk about interaction with other programs, in
> which case we should arguably follow them to be good neighbors. But
> other parts talk about the UI and only affect the contract between the
> application and the user. We have no obligation to follow those
> parts, tho of course it might make a lot of sense to make the default
> behavior follow those specs to avoid surprising the user.
>
> The change under discussion here was motivated by an optimization, so
> presumably it should not affect the interface between the user and
> Emacs, but only between Emacs and the system. So IIUC this is a part
> where the spec is indeed very relevant and we should strive to follow
> it. But I must say I don't know which part of the spec the change is
> related to. Could you clarify?
It's not related. Here I'm trying to convince people to not enable
`select-enable-primary' lightly, since that breaks other programs.
There seems to be a lot of bad advice floating around, and that's one of
them.
> These seem to only affect the contract between the user and Emacs, so if
> the users change them to their default, that can only hurt themselves.
>
> And AFAICT our default settings don't violate those parts 3, 4, and 5,
> so we're fine.
>
> And of course I still can't see in which way this relates to
> commit 99c637499e.
It doesn't relate, but I thought you were referring to the choice of
selection in the message I replied to earlier.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Don't change `select-enable-primary` (was: recent change to yanking behavior of the clipboard)
2022-02-07 13:17 ` Po Lu
@ 2022-02-07 13:50 ` Stefan Monnier
2022-02-07 13:55 ` Don't change `select-enable-primary` Po Lu
0 siblings, 1 reply; 38+ messages in thread
From: Stefan Monnier @ 2022-02-07 13:50 UTC (permalink / raw)
To: Po Lu; +Cc: Lars Ingebrigtsen, Noah Friedman, emacs-devel
> It's not related. Here I'm trying to convince people to not enable
> `select-enable-primary' lightly, since that breaks other programs.
Then please change the title.
Is there a particular reason you care what people do with their
`select-enable-primary`? E.g are you hoping to remove this var in some
(more or less distant) future because it would allow some important
simplification or performance improvement?
> There seems to be a lot of bad advice floating around, and that's one
> of them.
Indeed there is. I tend to focus on those that affect more than just
the people who follow that advice.
Stefan
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: Don't change `select-enable-primary`
2022-02-07 13:50 ` Don't change `select-enable-primary` (was: recent change to yanking behavior of the clipboard) Stefan Monnier
@ 2022-02-07 13:55 ` Po Lu
0 siblings, 0 replies; 38+ messages in thread
From: Po Lu @ 2022-02-07 13:55 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Lars Ingebrigtsen, Noah Friedman, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Is there a particular reason you care what people do with their
> `select-enable-primary`? E.g are you hoping to remove this var in
> some (more or less distant) future because it would allow some
> important simplification or performance improvement?
No, I'm just shocked by the amount of people who keep it on, and trying
to convince people who might've been affected by bad advice to
reconsider their choice.
> Indeed there is. I tend to focus on those that affect more than just
> the people who follow that advice.
I thought I was doing the former, but after reading what I wrote it
seems to mostly have been the latter.
I'm sorry for letting this discussion turn into that.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-06 7:37 ` Po Lu
` (3 preceding siblings ...)
2022-02-06 22:39 ` Lars Ingebrigtsen
@ 2022-02-07 1:11 ` Tim Cross
2022-02-07 2:31 ` Michael Welsh Duggan
4 siblings, 1 reply; 38+ messages in thread
From: Tim Cross @ 2022-02-07 1:11 UTC (permalink / raw)
To: emacs-devel
Po Lu <luangruo@yahoo.com> writes:
> Noah Friedman <noah@splode.com> writes:
>
>> This change in master:
>>
>> 2022-02-01 10:13:15 +0800 Po Lu <luangruo@yahoo.com> 99c637499e
>>
>> Only apply last change to the clipboard
>>
>> * lisp/select.el (gui--selection-value-internal): Only return
>> nil if we own the clipboard.
>>
>> Means that yanking never pastes the clipboard if I've programmatically set
>> the clipboard selection (which I do for both emacs and the sake of other
>> program windows that use it)
>
> If you assert ownership of CLIPBOARD from another program, then
> `gui-selection-value' (which is the interprogram-paste-function) will
> not return nil. If not, that program is buggy and should be fixed.
>
> Unless you are setting the clipboard inside Emacs via `x-set-selection',
> in which case see below:
>
>> But, curiously, you didn't make this change for the primary selection.
>
> Because, typically, Emacs does not keep a local ring for text stored
> into the primary selection. `select-enable-primary' is a violation of
> the XDG clipboard spec, and is unlikely to be used by many people, so I
> didn't enable that code there.
>
>> That means when I yank, I don't get the thing I've most recently copied to
>> the clipboard. I get some old thing from the primary selection.
>>
>> I don't understand how this new behavior is meant to be useful.
>
> It is meant to be useful by providing a visible performance improvement
> when Emacs is run over a network with moderate latency, by not querying
> the X server for the value of CLIPBOARD when text was last killed inside
> Emacs. And yes, that is what motivated me to install that change.
>
Just a question. What about Wayland? I ask this because recently there
was a post on the orgmode list where someone was getting inconsistent
behaviour between Emacs, emacsclient and other applications running the
pgtk version of Emacs under Wayland.
Given that Fedora has moved to defaulting to Wayland, Debian is
beginning to support Wayland and Ubuntu are moving in that direction,
combined with Emacs supporting a pure GTK implementation which (I
assume) means you could run Wayland without the legacy X integration,
should any refactoring of Emacs interaction with the clipboard also be
factoring in Wayland as another 'platform'?
Tim
P.S. Do many people still run Emacs remotely over X? I did this for a
long time (until things became very slow with font-locking). These days,
I find things like X2Go have become so good, I just use that and avoid
the performance hit of remote X and all that xauth merging etc.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: recent change to yanking behavior of the clipboard
2022-02-07 1:11 ` recent change to yanking behavior of the clipboard Tim Cross
@ 2022-02-07 2:31 ` Michael Welsh Duggan
0 siblings, 0 replies; 38+ messages in thread
From: Michael Welsh Duggan @ 2022-02-07 2:31 UTC (permalink / raw)
To: Tim Cross; +Cc: emacs-devel
Tim Cross <theophilusx@gmail.com> writes:
> P.S. Do many people still run Emacs remotely over X? I did this for a
> long time (until things became very slow with font-locking). These days,
> I find things like X2Go have become so good, I just use that and avoid
> the performance hit of remote X and all that xauth merging etc.
I don't know about many, but I still end up doing this while working
from home and working on a remote work machine, more days than most.
--
Michael Welsh Duggan
(md5i@md5i.com)
^ permalink raw reply [flat|nested] 38+ messages in thread