From 1166f9a73bd3b7b0f52510a0a2fce98cdab8b99b Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Wed, 18 Sep 2013 18:05:56 +0300 Subject: [PATCH] Re: emacs reply fills X clipboard with reply message body --- aa/8cfb41efb8ebc53ce71b279178fde6dbc0542c | 125 ++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 aa/8cfb41efb8ebc53ce71b279178fde6dbc0542c diff --git a/aa/8cfb41efb8ebc53ce71b279178fde6dbc0542c b/aa/8cfb41efb8ebc53ce71b279178fde6dbc0542c new file mode 100644 index 000000000..8016f68c9 --- /dev/null +++ b/aa/8cfb41efb8ebc53ce71b279178fde6dbc0542c @@ -0,0 +1,125 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id CC93B431FAF + for ; Wed, 18 Sep 2013 08:06:11 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id kGP3IkDmrghx for ; + Wed, 18 Sep 2013 08:06:03 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 1BF2F431FAE + for ; Wed, 18 Sep 2013 08:06:03 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 08F151000B2; + Wed, 18 Sep 2013 18:05:57 +0300 (EEST) +From: Tomi Ollila +To: Jameson Graef Rollins , + Notmuch Mail +Subject: Re: emacs reply fills X clipboard with reply message body +In-Reply-To: +References: <87vc1y6fbr.fsf@servo.finestructure.net> + +User-Agent: Notmuch/0.16+86~g2d126a3 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 18 Sep 2013 15:06:12 -0000 + +On Wed, Sep 18 2013, Tomi Ollila wrote: + +> On Wed, Sep 18 2013, Jameson Graef Rollins w= +rote: +> +>> 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-r= +egion + + +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=E2=84=A2 has to dig (deeper) into the code for this... +> +>> jamie. +> +> Tomi + +Tomi -- 2.26.2