GNU bug report logs - #17211
Empty items show up in kill-ring if mouse-drag-copy-region is used

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Richard Smith <rsmithnews@HIDDEN>; dated Sun, 6 Apr 2014 23:58:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Apr 2014 23:57:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 06 19:57:02 2014
Received: from localhost ([127.0.0.1]:38546 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1WWwvt-0001rm-SO
	for submit <at> debbugs.gnu.org; Sun, 06 Apr 2014 19:57:02 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40137)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rsmithnews@HIDDEN>) id 1WWv0I-000796-Oa
 for submit <at> debbugs.gnu.org; Sun, 06 Apr 2014 17:53:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rsmithnews@HIDDEN>) id 1WWv0H-0001EC-8w
 for submit <at> debbugs.gnu.org; Sun, 06 Apr 2014 17:53:26 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:35785)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rsmithnews@HIDDEN>) id 1WWv0H-0001E7-5g
 for submit <at> debbugs.gnu.org; Sun, 06 Apr 2014 17:53:25 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41859)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rsmithnews@HIDDEN>) id 1WWv0G-0000ae-1y
 for bug-gnu-emacs@HIDDEN; Sun, 06 Apr 2014 17:53:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rsmithnews@HIDDEN>) id 1WWv0F-0001Dh-2i
 for bug-gnu-emacs@HIDDEN; Sun, 06 Apr 2014 17:53:23 -0400
Received: from mail-wi0-x241.google.com ([2a00:1450:400c:c05::241]:49330)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rsmithnews@HIDDEN>) id 1WWv0E-0001Db-Nt
 for bug-gnu-emacs@HIDDEN; Sun, 06 Apr 2014 17:53:23 -0400
Received: by mail-wi0-f193.google.com with SMTP id n15so1849717wiw.8
 for <bug-gnu-emacs@HIDDEN>; Sun, 06 Apr 2014 14:53:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=CI27V3vLKY6xnWJ3tw8wZzPgLEgi0QY9xmdLSmvJhaE=;
 b=jlKb6NARsMNcte8k+TXwaSxzuZNSbrTaKDh7I5+15E06M1Mtcwe2bWc16+kHnaImZD
 Yy7BVZ95rzXLMmoL0j8Ue7Um3kJLggQZ/yrdBc/6Tqd6Ek2qOmWtF4b1BkHgyK7nEFO1
 xuNoGnYo4ESAi8YnZiueQCpnxVkxTsJdc+609ruxG2N62RyQ8F1/N/3WOy+FEoc9xlJ+
 ZUO/9CeSXwU3FW6Klsq/0cAc5JfNb+uND3jOdQTEhid6zUi29IuZWDNnTiSX72nXrt/X
 XOpn7MaJVZOB73yHVO2Hat1+UZIABE75ZRoecOOvN/ge+f4T3O65LoCJ/CaJKmGC4iYX
 zhgA==
MIME-Version: 1.0
X-Received: by 10.194.188.41 with SMTP id fx9mr37913191wjc.56.1396821201236;
 Sun, 06 Apr 2014 14:53:21 -0700 (PDT)
Received: by 10.216.240.200 with HTTP; Sun, 6 Apr 2014 14:53:21 -0700 (PDT)
Date: Sun, 6 Apr 2014 14:53:21 -0700
Message-ID: <CACE1RH1kLpiRiv==N3jesD3NFCeS+d6SeXqy_mKxp43wjg2zRA@HIDDEN>
Subject: Empty items show up in kill-ring if mouse-drag-copy-region is used
From: Richard Smith <rsmithnews@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary=047d7beb909c83b74704f666c752
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 06 Apr 2014 19:57:00 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

--047d7beb909c83b74704f666c752
Content-Type: text/plain; charset=ISO-8859-1

Emacs version: 24.3.1
Platform: Windows 7, confirmed in Linux

Problem:

Windows users who set up Emacs to cut/paste from the kill-ring get empty
paste results.

Details:

Windows users who are having difficulty with cut/paste behavior are often
advised to do the following:

(setq select-active-regions nil)
(setq mouse-drag-copy-region t)
(global-set-key [mouse-2] 'mouse-yank-at-click)

But if, in the process of pasting text, you click, then drag the mouse even
a few pixels, this causes an empty string to go into the kill-ring, so a
subsequent paste inserts nothing, but an examination of the kill-ring
indicates the desired paste value has been pushed down by the empty string.

Steps to reproduce:

1. Enter lisp-interaction mode.

2. Set up the "normal behavior" by executing this form:

(progn
  (setq select-active-regions t)
  (setq mouse-drag-copy-region nil)
  (global-set-key [mouse-2] 'mouse-yank-primary))

3. Select some text buy dragging mouse-1 over it.

4. Move to a different area in the buffer and set point with down-mouse-1,
but move the mouse a few pixels so you see the "Mark Set" message.

5. Paste the text with down-mouse-2.

6. Observe the correct behavior (text gets pasted).

7. Now, set up the "modified behavior" by executing this form:

(progn
  (setq select-active-regions nil)
  (setq mouse-drag-copy-region t)
  (global-set-key [mouse-2] 'mouse-yank-at-click))

8. Repeat steps 3 thru 5.

9. Observe that nothing is pasted.

10. Execute the following form to "fix" the problem:

(progn
  (setq kill-ring (remove "" kill-ring))
  (setq kill-ring-yank-pointer kill-ring))

11. Do the mouse-2 paste again, observe that it worked this time.

--047d7beb909c83b74704f666c752
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Emacs version: 24.3.1=A0</div><div>Platform: Windows 7, confirmed in L=
inux=A0</div><div><br></div><div>Problem:=A0</div><div><br></div><div>Windo=
ws users who set up Emacs to cut/paste from the kill-ring get empty paste r=
esults.=A0</div>
<div><br></div><div>Details:=A0</div><div><br></div><div>Windows users who =
are having difficulty with cut/paste behavior are often advised to do the f=
ollowing:=A0</div><div><br></div><div>(setq select-active-regions nil)=A0</=
div>
<div>(setq mouse-drag-copy-region t)=A0</div><div>(global-set-key [mouse-2]=
 &#39;mouse-yank-at-click)=A0</div><div><br></div><div>But if, in the proce=
ss of pasting text, you click, then drag the mouse even a few pixels, this =
causes an empty string to go into the kill-ring, so a subsequent paste inse=
rts nothing, but an examination of the kill-ring indicates the desired past=
e value has been pushed down by the empty string.=A0</div>
<div><br></div><div>Steps to reproduce:=A0</div><div><br></div><div>1. Ente=
r lisp-interaction mode.=A0</div><div><br></div><div>2. Set up the &quot;no=
rmal behavior&quot; by executing this form:=A0</div><div><br></div><div>(pr=
ogn=A0</div>
<div>=A0 (setq select-active-regions t)=A0</div><div>=A0 (setq mouse-drag-c=
opy-region nil)=A0</div><div>=A0 (global-set-key [mouse-2] &#39;mouse-yank-=
primary))=A0</div><div><br></div><div>3. Select some text buy dragging mous=
e-1 over it.=A0</div>
<div><br></div><div>4. Move to a different area in the buffer and set point=
 with down-mouse-1, but move the mouse a few pixels so you see the &quot;Ma=
rk Set&quot; message.=A0</div><div><br></div><div>5. Paste the text with do=
wn-mouse-2.=A0</div>
<div><br></div><div>6. Observe the correct behavior (text gets pasted).=A0<=
/div><div><br></div><div>7. Now, set up the &quot;modified behavior&quot; b=
y executing this form:=A0</div><div><br></div><div>(progn=A0</div><div>=A0 =
(setq select-active-regions nil)=A0</div>
<div>=A0 (setq mouse-drag-copy-region t)=A0</div><div>=A0 (global-set-key [=
mouse-2] &#39;mouse-yank-at-click))=A0</div><div><br></div><div>8. Repeat s=
teps 3 thru 5.=A0</div><div><br></div><div>9. Observe that nothing is paste=
d.=A0</div>
<div><br></div><div>10. Execute the following form to &quot;fix&quot; the p=
roblem:=A0</div><div><br></div><div>(progn=A0</div><div>=A0 (setq kill-ring=
 (remove &quot;&quot; kill-ring))=A0</div><div>=A0 (setq kill-ring-yank-poi=
nter kill-ring))=A0</div>
<div><br></div><div>11. Do the mouse-2 paste again, observe that it worked =
this time.=A0</div>

--047d7beb909c83b74704f666c752--




Acknowledgement sent to Richard Smith <rsmithnews@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#17211; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.