unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* emacs reply fills X clipboard with reply message body
@ 2013-09-18  2:20 Jameson Graef Rollins
  2013-09-18  6:09 ` Tomi Ollila
  2014-05-08 14:45 ` David Edmondson
  0 siblings, 2 replies; 8+ messages in thread
From: Jameson Graef Rollins @ 2013-09-18  2:20 UTC (permalink / raw)
  To: Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

I've just started noticing that when I reply to messages from the emacs
UI, my X clipboard is filled with the body of the reply message,
displacing whatever was in there previously.  I'm not sure if this is
related to my personal emacs configuration, or some non-ideal way we're
inserting body parts in replies.  However, even if it is a configuration
issue in my emacs, I suspect that there should be a better way to insert
the reply body such that there's not even a possibility that it would
leak into the users X clipboard, regardless of emacs settings.  Any
thoughts?

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs reply fills X clipboard with reply message body
  2013-09-18  2:20 emacs reply fills X clipboard with reply message body Jameson Graef Rollins
@ 2013-09-18  6:09 ` Tomi Ollila
  2013-09-18 15:05   ` Tomi Ollila
  2013-09-18 22:28   ` Mark Walters
  2014-05-08 14:45 ` David Edmondson
  1 sibling, 2 replies; 8+ messages in thread
From: Tomi Ollila @ 2013-09-18  6:09 UTC (permalink / raw)
  To: Jameson Graef Rollins, Notmuch Mail

On Wed, Sep 18 2013, Jameson Graef Rollins <jrollins@finestructure.net> wrote:

> I've just started noticing that when I reply to messages from the emacs
> UI, my X clipboard is filled with the body of the reply message,
> displacing whatever was in there previously.  I'm not sure if this is
> related to my personal emacs configuration, or some non-ideal way we're
> inserting body parts in replies.  However, even if it is a configuration
> issue in my emacs, I suspect that there should be a better way to insert
> the reply body such that there's not even a possibility that it would
> leak into the users X clipboard, regardless of emacs settings.  Any
> thoughts?

env -u DISPLAY emacs -f notmuch ;)


.. OK, I'm marking this as a bug -- I witness the same behaviour.

Originally I thought this relates directly to the fact that mark
is set at the end of quoted text and (point) is at the beginning of
buffer -- so that simple c-w can be used to remove the contents in
case desired... but the X paste provides the original text, not the
quoted one.

Someone™ has to dig (deeper) into the code for this...

> jamie.

Tomi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs reply fills X clipboard with reply message body
  2013-09-18  6:09 ` Tomi Ollila
@ 2013-09-18 15:05   ` Tomi Ollila
  2013-09-18 22:28   ` Mark Walters
  1 sibling, 0 replies; 8+ messages in thread
From: Tomi Ollila @ 2013-09-18 15:05 UTC (permalink / raw)
  To: Jameson Graef Rollins, Notmuch Mail

On Wed, Sep 18 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:

> On Wed, Sep 18 2013, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
>
>> I've just started noticing that when I reply to messages from the emacs
>> UI, my X clipboard is filled with the body of the reply message,
>> displacing whatever was in there previously.  I'm not sure if this is
>> related to my personal emacs configuration, or some non-ideal way we're
>> inserting body parts in replies.  However, even if it is a configuration
>> issue in my emacs, I suspect that there should be a better way to insert
>> the reply body such that there's not even a possibility that it would
>> leak into the users X clipboard, regardless of emacs settings.  Any
>> thoughts?

I tracked this to notmuch-mua-reply -> message-cite-original -> mml-quote-region


In emacs "24.3.50.1" when I set mark, move point and do M-x
mml-quote-region -- and then press middle mouse button, the text between
point & mark are pasted.

In emacs "23.4.1" this does not happen...

mml-quote-region looks like:

(defun mml-quote-region (beg end)
  "Quote the MML tags in the region."
  (interactive "r")
  (save-excursion
    (save-restriction
      ;; Temporarily narrow the region to defend from changes
      ;; invalidating END.
      (narrow-to-region beg end)
      (goto-char (point-min))
      ;; Quote parts.
      (while (re-search-forward
              "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)" nil t)
        ;; Insert ! after the #.
        (goto-char (+ (match-beginning 0) 2))
        (insert "!")))))


So, some magic emacs feature ?

Attempted to shadow this by setting x-select-enable-* values
to nil but no effect...


Does others experience the same behaviour. Am I missing something here ?

>
> env -u DISPLAY emacs -f notmuch ;)
>
>
> .. OK, I'm marking this as a bug -- I witness the same behaviour.
>
> Originally I thought this relates directly to the fact that mark
> is set at the end of quoted text and (point) is at the beginning of
> buffer -- so that simple c-w can be used to remove the contents in
> case desired... but the X paste provides the original text, not the
> quoted one.
>
> Someone™ has to dig (deeper) into the code for this...
>
>> jamie.
>
> Tomi

Tomi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs reply fills X clipboard with reply message body
  2013-09-18  6:09 ` Tomi Ollila
  2013-09-18 15:05   ` Tomi Ollila
@ 2013-09-18 22:28   ` Mark Walters
  2013-09-19  6:28     ` Tomi Ollila
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Walters @ 2013-09-18 22:28 UTC (permalink / raw)
  To: Tomi Ollila, Jameson Graef Rollins, Notmuch Mail


I have looked at this but haven't fully worked out what is going on.

Tomi found (on irc) that putting a (select-active-regions nil) to line
212 of notmuch-mua.el solves the problem.

My testing shows that putting a (let ((select-active-regions nil))
around the lines 224-227 in notmuch-mua.el also solves the problem.

However, when trying to narrow the problem I see some odd behaviour: if
you put the let just around the message-cite-original line then the
following happens:

if the primary selection is in some non-emacs window (eg an xterm) then
the bug does not show up but if the primary selection is in the emacs
window and then you initiate the reply then the bug does show up. 

We could just try one of the above two fixes but it could be papering
over something.

Best wishes

Mark




On Wed, 18 Sep 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Wed, Sep 18 2013, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
>
>> I've just started noticing that when I reply to messages from the emacs
>> UI, my X clipboard is filled with the body of the reply message,
>> displacing whatever was in there previously.  I'm not sure if this is
>> related to my personal emacs configuration, or some non-ideal way we're
>> inserting body parts in replies.  However, even if it is a configuration
>> issue in my emacs, I suspect that there should be a better way to insert
>> the reply body such that there's not even a possibility that it would
>> leak into the users X clipboard, regardless of emacs settings.  Any
>> thoughts?
>
> env -u DISPLAY emacs -f notmuch ;)
>
>
> .. OK, I'm marking this as a bug -- I witness the same behaviour.
>
> Originally I thought this relates directly to the fact that mark
> is set at the end of quoted text and (point) is at the beginning of
> buffer -- so that simple c-w can be used to remove the contents in
> case desired... but the X paste provides the original text, not the
> quoted one.
>
> Someone™ has to dig (deeper) into the code for this...
>
>> jamie.
>
> Tomi
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs reply fills X clipboard with reply message body
  2013-09-18 22:28   ` Mark Walters
@ 2013-09-19  6:28     ` Tomi Ollila
  0 siblings, 0 replies; 8+ messages in thread
From: Tomi Ollila @ 2013-09-19  6:28 UTC (permalink / raw)
  To: Mark Walters, Jameson Graef Rollins, Notmuch Mail

On Thu, Sep 19 2013, Mark Walters <markwalters1009@gmail.com> wrote:

> I have looked at this but haven't fully worked out what is going on.
>
> Tomi found (on irc) that putting a (select-active-regions nil) to line
> 212 of notmuch-mua.el solves the problem.

You found that it was select-active-regions what to try ...

> My testing shows that putting a (let ((select-active-regions nil))
> around the lines 224-227 in notmuch-mua.el also solves the problem.
>
> However, when trying to narrow the problem I see some odd behaviour: if
> you put the let just around the message-cite-original line then the
> following happens:
>
> if the primary selection is in some non-emacs window (eg an xterm) then
> the bug does not show up but if the primary selection is in the emacs
> window and then you initiate the reply then the bug does show up. 
>
> We could just try one of the above two fixes but it could be papering
> over something.

Yes, such duct-taping something is probably not the best approach;
we could use that as a "temporary" solution but you know what happens
with these "temporary" solutions.

Also, doing these ad-hoc testing switching between emacs 23 & 24 and
something doing "mouse-draggin" or "shift-selection" (*) and other 
times C-SPC and then moving cursor (and forgetting which approach is
tried get things confusing).

(*) mouse-dragging & shift-selection taken from the documentation string
of variable select-active-regions. It seems that 'only is the value 
I personally want to use there....

... have to try the 'only option -- and also disabling transient-mark-mode
-- how to do that is a question (the docstring is a bit confusing and it
seems although I have (transient-mark-mode t) it is enabled -- how to
know transient-mark-mode is enabled is also a bit of mystery to me :/


Forget my mml-quote-reqion -comment in my previous mail. although the
diagnose was wrong the cure was working ;/


> Best wishes
>
> Mark

Tomi

>
>
>
>
> On Wed, 18 Sep 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:
>> On Wed, Sep 18 2013, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
>>
>>> I've just started noticing that when I reply to messages from the emacs
>>> UI, my X clipboard is filled with the body of the reply message,
>>> displacing whatever was in there previously.  I'm not sure if this is
>>> related to my personal emacs configuration, or some non-ideal way we're
>>> inserting body parts in replies.  However, even if it is a configuration
>>> issue in my emacs, I suspect that there should be a better way to insert
>>> the reply body such that there's not even a possibility that it would
>>> leak into the users X clipboard, regardless of emacs settings.  Any
>>> thoughts?
>>
>> env -u DISPLAY emacs -f notmuch ;)
>>
>>
>> .. OK, I'm marking this as a bug -- I witness the same behaviour.
>>
>> Originally I thought this relates directly to the fact that mark
>> is set at the end of quoted text and (point) is at the beginning of
>> buffer -- so that simple c-w can be used to remove the contents in
>> case desired... but the X paste provides the original text, not the
>> quoted one.
>>
>> Someone™ has to dig (deeper) into the code for this...
>>
>>> jamie.
>>
>> Tomi
>>
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs reply fills X clipboard with reply message body
  2013-09-18  2:20 emacs reply fills X clipboard with reply message body Jameson Graef Rollins
  2013-09-18  6:09 ` Tomi Ollila
@ 2014-05-08 14:45 ` David Edmondson
  2014-05-08 16:08   ` Jameson Graef Rollins
  1 sibling, 1 reply; 8+ messages in thread
From: David Edmondson @ 2014-05-08 14:45 UTC (permalink / raw)
  To: Jameson Graef Rollins, Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

[ I'm cycling around back through some old mail. ]

On Tue, Sep 17 2013, Jameson Graef Rollins wrote:
> I've just started noticing that when I reply to messages from the emacs
> UI, my X clipboard is filled with the body of the reply message,
> displacing whatever was in there previously.

This doesn't happen to me today. Is it still a problem for other people?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 310 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs reply fills X clipboard with reply message body
  2014-05-08 14:45 ` David Edmondson
@ 2014-05-08 16:08   ` Jameson Graef Rollins
  2014-05-08 23:33     ` David Bremner
  0 siblings, 1 reply; 8+ messages in thread
From: Jameson Graef Rollins @ 2014-05-08 16:08 UTC (permalink / raw)
  To: David Edmondson, Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

On Thu, May 08 2014, David Edmondson <dme@dme.org> wrote:
> [ I'm cycling around back through some old mail. ]
>
> On Tue, Sep 17 2013, Jameson Graef Rollins wrote:
>> I've just started noticing that when I reply to messages from the emacs
>> UI, my X clipboard is filled with the body of the reply message,
>> displacing whatever was in there previously.
>
> This doesn't happen to me today. Is it still a problem for other people?

This was fixed a while back, although I don't remember which series it
was that fixed it.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs reply fills X clipboard with reply message body
  2014-05-08 16:08   ` Jameson Graef Rollins
@ 2014-05-08 23:33     ` David Bremner
  0 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2014-05-08 23:33 UTC (permalink / raw)
  To: Jameson Graef Rollins, David Edmondson, Notmuch Mail

Jameson Graef Rollins <jrollins@finestructure.net> writes:

> On Thu, May 08 2014, David Edmondson <dme@dme.org> wrote:
>> [ I'm cycling around back through some old mail. ]
>>
>> On Tue, Sep 17 2013, Jameson Graef Rollins wrote:
>>> I've just started noticing that when I reply to messages from the emacs
>>> UI, my X clipboard is filled with the body of the reply message,
>>> displacing whatever was in there previously.
>>
>> This doesn't happen to me today. Is it still a problem for other people?
>
> This was fixed a while back, although I don't remember which series it
> was that fixed it.

The amazing Mark Walters and commit 4eb151e26ce0 ?

d

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-05-08 23:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-18  2:20 emacs reply fills X clipboard with reply message body Jameson Graef Rollins
2013-09-18  6:09 ` Tomi Ollila
2013-09-18 15:05   ` Tomi Ollila
2013-09-18 22:28   ` Mark Walters
2013-09-19  6:28     ` Tomi Ollila
2014-05-08 14:45 ` David Edmondson
2014-05-08 16:08   ` Jameson Graef Rollins
2014-05-08 23:33     ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).