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: Sat, 04 Sep 2010 22:38:22 +0100 Message-ID: <4C82BC4E.4080500@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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090306060805000108070706" X-Trace: dough.gmane.org 1283636409 15324 80.91.229.12 (4 Sep 2010 21:40:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 4 Sep 2010 21:40:09 +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 Sat Sep 04 23:40:07 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 1Os0T1-000121-0U for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Sep 2010 23:40:07 +0200 Original-Received: from localhost ([127.0.0.1]:42092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Os0T0-00005x-AG for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Sep 2010 17:40:06 -0400 Original-Received: from [140.186.70.92] (port=33828 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Os0Ss-00004s-Cb for bug-gnu-emacs@gnu.org; Sat, 04 Sep 2010 17:39:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Os0Sr-0005S0-Dp for bug-gnu-emacs@gnu.org; Sat, 04 Sep 2010 17:39:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35001) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Os0Sr-0005Rv-BB for bug-gnu-emacs@gnu.org; Sat, 04 Sep 2010 17:39:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Os0Q2-0004zM-H0; Sat, 04 Sep 2010 17:37: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: Sat, 04 Sep 2010 21:37: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.128363619819168 (code B ref 6956); Sat, 04 Sep 2010 21:37:02 +0000 Original-Received: (at 6956) by debbugs.gnu.org; 4 Sep 2010 21:36:38 +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 1Os0Pe-0004z7-GA for submit@debbugs.gnu.org; Sat, 04 Sep 2010 17:36:38 -0400 Original-Received: from harpegolden.net ([65.99.215.13]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Os0Pc-0004z2-5B for 6956@debbugs.gnu.org; Sat, 04 Sep 2010 17:36:36 -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 5244B684BF; Sat, 4 Sep 2010 22:38:20 +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: <4C82AD90.5040003@harpegolden.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 04 Sep 2010 17:37: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:39975 Archived-At: This is a multi-part message in MIME format. --------------090306060805000108070706 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 04/09/10 21:35, David De La Harpe Golden wrote: > We _don't_ want a new kill ring entry for each new mouse-3 click in a > different position for a given region activation, we want it to replace > the front of kill-ring if it's extending a region that's already been > saved to the kill ring previously in the same activation. > How about the attached? --------------090306060805000108070706 Content-Type: text/x-patch; name="mouse-save-then-kill-save-on-mdcr_r1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mouse-save-then-kill-save-on-mdcr_r1.diff" === modified file 'lisp/mouse.el' --- lisp/mouse.el 2010-08-29 16:17:13 +0000 +++ lisp/mouse.el 2010-09-04 21:33:14 +0000 @@ -43,7 +43,11 @@ :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. + +For consistency this affects both actual mouse drag operations and +`mouse-save-then-kill' (\\[mouse-save-then-kill]) operations that +change the region." :type 'boolean :version "24.1" :group 'mouse) @@ -1342,14 +1346,21 @@ If the region is inactive, activate it temporarily. Set mark at the original point, and move point to the position of CLICK. +If `mouse-drag-copy-region' is non-nil, also save the region +to the kill ring. If the region is already active, adjust it. Normally, do this by moving point or mark, whichever is closer, to CLICK. But if you 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, also save the region +to the kill ring, replacing the previous kill corresponding +to the already active region. 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 - it will already +have been saved to the kill ring by the previous click.)" (interactive "e") (mouse-minibuffer-check click) (let* ((posn (event-start click)) @@ -1371,7 +1382,12 @@ ((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 deactivate-mark t) (setq mouse-selection-click-count 0) (setq mouse-save-then-kill-posn nil)) @@ -1394,6 +1410,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 +1424,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))))) --------------090306060805000108070706--