Re: [PATCH] emacs: do not put quoted reply in primary selection

Subject: Re: [PATCH] emacs: do not put quoted reply in primary selection

Date: Sun, 17 Nov 2013 20:41:19 +0000

To: Tomi Ollila, Jameson Graef Rollins, notmuch@notmuchmail.org

Cc:

From: Mark Walters


On Sun, 17 Nov 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Sun, Nov 17 2013, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
>
>> On Sun, Nov 17 2013, Mark Walters <markwalters1009@gmail.com> wrote:
>>> In current emacs (24.3) select-active-regions is set to t by
>>> default. The reply insertion code sets the region to the quoted
>>> message to make it easy to delete (kill-region or C-w). These two
>>> things combine to put the quoted message in the primary selection.
>>>
>>> This is not what the user wanted and is a privacy risk (accidental
>>> pasting of the quoted message). We can avoid some of the problems
>>> by let-binding select-active-regions to nil. This fixes if the
>>> primary selection was previously in a non-emacs window but not if
>>> it was in an emacs window. To avoid the problem in the latter case
>>> we deactivate mark.
>>>
>>> One key test (which fails under many simpler "fixes") is: open emacs
>>> 24.3 with notmuch, open 2 windows (viewing different notmuch buffers),
>>> highlight some text in one, and then reply to a message in the
>>> other. In many of my earlier attempts to fix this big this test fails.
>>
>> I'm very happy to report that I reply to this message with an unpolluted
>> paste buffer!  Kudos Mark!
>>
>>> Anyway, this is the best I can manage!
>>
>> Too modest for such an achievement.
>>
>> +10
>
> This works for me too (and tests pass). 

That's great.

> I don't see how this could break thinks, So I think this is important
> enough th be included in 0.17 


I think the only thing that could break is the ability to cut the quoted
message with kill-region/ctrl-w. That is probably minor enough that we
do not need to worry too much.

Best wishes

Mark

Thread: