From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David De La Harpe Golden Newsgroups: gmane.emacs.bugs Subject: bug#6956: 24.0.50; pasting mouse selection in other session pastes only first word Date: Sun, 05 Sep 2010 15:36:58 +0100 Message-ID: <4C83AB0A.8040605@harpegolden.net> References: <296F488C207B496D9CA42F4AA0F7C835@us.oracle.com> <83eidek812.fsf@gnu.org> <87eideejlh.fsf@stupidchicken.com> <838w3ljzq0.fsf@gnu.org> <83bp8eht8b.fsf@gnu.org> <4C8204D6.5020201@swipnet.se> <8339tpix6o.fsf@gnu.org> <87hbi58gxc.fsf@stupidchicken.com> <4C82AD90.5040003@harpegolden.net> <4C82BC4E.4080500@harpegolden.net> <87pqwtuf9x.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070003030100000901030806" X-Trace: dough.gmane.org 1283697612 15217 80.91.229.12 (5 Sep 2010 14:40:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 5 Sep 2010 14:40:12 +0000 (UTC) Cc: 6956@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 05 16:40:09 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OsGO9-0002kN-1k for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Sep 2010 16:40:09 +0200 Original-Received: from localhost ([127.0.0.1]:47861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OsGO7-00088p-Hf for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Sep 2010 10:40:07 -0400 Original-Received: from [140.186.70.92] (port=42177 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OsGO0-00088f-RH for bug-gnu-emacs@gnu.org; Sun, 05 Sep 2010 10:40:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OsGNz-0003Ok-KN for bug-gnu-emacs@gnu.org; Sun, 05 Sep 2010 10:40:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53782) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsGNz-0003Of-HN for bug-gnu-emacs@gnu.org; Sun, 05 Sep 2010 10:39:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OsGKA-0003mv-BP; Sun, 05 Sep 2010 10:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David De La Harpe Golden Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Sep 2010 14:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6956 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6956-submit@debbugs.gnu.org id=B6956.128369731314543 (code B ref 6956); Sun, 05 Sep 2010 14:36:02 +0000 Original-Received: (at 6956) by debbugs.gnu.org; 5 Sep 2010 14:35:13 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsGJM-0003mW-Ma for submit@debbugs.gnu.org; Sun, 05 Sep 2010 10:35:13 -0400 Original-Received: from harpegolden.net ([65.99.215.13]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsGJK-0003lU-HP for 6956@debbugs.gnu.org; Sun, 05 Sep 2010 10:35:11 -0400 Original-Received: from [87.198.55.208] (87-198-55-208.ptr.magnet.ie [87.198.55.208]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 3" (verified OK)) by harpegolden.net (Postfix) with ESMTPSA id 7C42C684A8; Sun, 5 Sep 2010 15:36:56 +0100 (IST) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100805 Icedove/3.0.6 In-Reply-To: <87pqwtuf9x.fsf@stupidchicken.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 05 Sep 2010 10:36:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:39994 Archived-At: This is a multi-part message in MIME format. --------------070003030100000901030806 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 05/09/10 02:53, Chong Yidong wrote: > We don't need to explain what mouse-drag-copy-region does twice. > Just add a separate paragraph saying > > If `mouse-drag-copy-region' is non-nil, this command also saves the > region to the kill ring, replacing the previous kill if it was also > made with `mouse-save-then-kill'. > ^^^ Strictly that's not true, it also replaces kills made by mouse-drag i.e. an already active region (otherwise you would drag select a region with mouse-1, then mouse-3 extend, and you'd get two kill ring entries). Here's one with revised doc phrasing. ...I haven't tried making shift-selection respect "mouse"-"drag"-copy-region as yet, but that should be straightforward given similarity to the "select-active-regions => 'only" code path. (It's not like I'm personally going to use mouse-drag-copy-region => t in any case....) The customization name would then be kind of misleading, but, well, it has company. Effectively, mouse-drag-copy-region would "really" be something like the (hypothetical) "clipboard-active-regions => 'only" in end effect, though probably implemented by hitting the kill ring and thus (maybe) the os clipboard as a side effect, so maybe "killring-active-regions => 'only" would be more accurate. --------------070003030100000901030806 Content-Type: text/x-patch; name="mouse-save-then-kill-save-on-mdcr_r2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mouse-save-then-kill-save-on-mdcr_r2.diff" === modified file 'lisp/mouse.el' --- lisp/mouse.el 2010-08-29 16:17:13 +0000 +++ lisp/mouse.el 2010-09-05 14:07:38 +0000 @@ -43,7 +43,10 @@ :group 'mouse) (defcustom mouse-drag-copy-region nil - "If non-nil, mouse drag copies region to kill-ring." + "If non-nil, copy to kill-ring upon mouse adjustments of the region. + +This affects `mouse-save-then-kill' (\\[mouse-save-then-kill]) in +addition to mouse drags." :type 'boolean :version "24.1" :group 'mouse) @@ -1348,8 +1351,13 @@ have selected whole words or lines, move point or mark to the word or line boundary closest to CLICK instead. +If `mouse-drag-copy-region' is non-nil, this command also saves the +new region to the kill ring (replacing the previous kill if the +previous region was just saved to the kill ring). + If this command is called a second consecutive time with the same -CLICK position, kill the region." +CLICK position, kill the region (or delete it +if `mouse-drag-copy-region' is non-nil)" (interactive "e") (mouse-minibuffer-check click) (let* ((posn (event-start click)) @@ -1371,7 +1379,11 @@ ((and (eq last-command 'mouse-save-then-kill) (eq click-pt mouse-save-then-kill-posn) (eq window (selected-window))) - (kill-region (mark t) (point)) + (if mouse-drag-copy-region + ;; region already saved the previous click, + ;; don't make a duplicate entry, just delete + (delete-region (mark t) (point)) + (kill-region (mark t) (point))) (setq mouse-selection-click-count 0) (setq mouse-save-then-kill-posn nil)) @@ -1394,6 +1406,9 @@ (goto-char (nth 1 range))) (setq deactivate-mark nil) (mouse-set-region-1) + (when mouse-drag-copy-region + ;; presumably region already copied to kill-ring once, so replace. + (kill-new (filter-buffer-substring (mark t) (point)) t)) ;; Arrange for a repeated mouse-3 to kill the region. (setq mouse-save-then-kill-posn click-pt))) @@ -1405,6 +1420,8 @@ (if before-scroll (goto-char before-scroll))) (exchange-point-and-mark) (mouse-set-region-1) + (when mouse-drag-copy-region + (kill-new (filter-buffer-substring (mark t) (point)))) (setq mouse-save-then-kill-posn click-pt))))) --------------070003030100000901030806--