emacs reply fills X clipboard with reply message body

Tomi Ollila tomi.ollila at iki.fi
Wed Sep 18 08:05:56 PDT 2013


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

> On Wed, Sep 18 2013, Jameson Graef Rollins <jrollins at 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


More information about the notmuch mailing list