From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#6774: Cut and paste with C-w/mouse-2 not working? Date: Tue, 17 Aug 2010 10:44:59 +0900 Message-ID: References: <4C55EF50.3080100@alice.it> <4C573A2A.3030007@harpegolden.net> <8762zphkaw.fsf@stupidchicken.com> <4C5B4E28.4090808@harpegolden.net> <87fwyr3glm.fsf@stupidchicken.com> <4C5C7915.7080407@harpegolden.net> <87hbj6jj7o.fsf@stupidchicken.com> <4C5DE6C7.5080706@harpegolden.net> <87vd7kcx52.fsf@stupidchicken.com> <4C6038B9.1090508@swipnet.se> <4C615BB9.8030905@swipnet.se> <4C61938B.5080302@swipnet.se> <4C68FBF7.1080104@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1282010957 11647 80.91.229.12 (17 Aug 2010 02:09:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 17 Aug 2010 02:09:17 +0000 (UTC) Cc: cyd@stupidchicken.com, 6774@debbugs.gnu.org, angelo.graziosi@alice.it To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 17 04:09:16 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 1OlBc2-0000c5-BA for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Aug 2010 04:09:14 +0200 Original-Received: from localhost ([127.0.0.1]:58460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OlBc1-0006BL-MX for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Aug 2010 22:09:13 -0400 Original-Received: from [140.186.70.92] (port=37275 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OlBbk-00065h-TQ for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2010 22:08:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OlBbj-00048m-HV for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2010 22:08:56 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53780) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OlBbj-00048i-EG for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2010 22:08:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OlBEc-00085f-CS; Mon, 16 Aug 2010 21:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kenichi Handa Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Aug 2010 01:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6774-submit@debbugs.gnu.org id=B6774.128200945231078 (code B ref 6774); Tue, 17 Aug 2010 01:45:02 +0000 Original-Received: (at 6774) by debbugs.gnu.org; 17 Aug 2010 01:44:12 +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 1OlBDn-00085D-G6 for submit@debbugs.gnu.org; Mon, 16 Aug 2010 21:44:11 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OlBDk-00084q-28 for 6774@debbugs.gnu.org; Mon, 16 Aug 2010 21:44:09 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id o7H1j1h4016923; Tue, 17 Aug 2010 10:45:01 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id o7H1j1G4027125; Tue, 17 Aug 2010 10:45:01 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp2.aist.go.jp with ESMTP id o7H1ixxI010583; Tue, 17 Aug 2010 10:44:59 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.71) (envelope-from ) id 1OlBEZ-00005M-7c; Tue, 17 Aug 2010 10:44:59 +0900 In-Reply-To: <4C68FBF7.1080104@swipnet.se> (message from =?ISO-8859-1?Q?Jan_Dj=E4rv?= on Mon, 16 Aug 2010 10:51:03 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 16 Aug 2010 21:45: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:39556 Archived-At: In article <4C68FBF7.1080104@swipnet.se>, Jan Dj=E4rv = writes: > > We own the primary selection when mark is activated by C-@ > > in transient-mark-mode or C-@ C-@ not in > > transient-mark-mode, and record somehow that selection is > > owned that way (i.e. selection contents is a text in the > > region). At that time the contents is null, but I think > > it's not the problem. We do nothing special for all point > > moving commands (except for highlighting the region). When > > Emacs receives selection request, it returns the text in the > > region if the selection is still owned as the above way. We > > disown the selection when mark is deactivated. > > > I though we where moving away from special cases? Anyway, empty selectio= n do=20 > matter. Consider this case: > I select a lot of code in another application. > I go to Emacs and set mark, then paste the code with mouse-2 and then M-x= =20 > indent-region. > With your scheme, mouse-2 would fail to paste, which would be a nasty sur= prise. Surely this is not good. But which is a nastier surprise for new users, your case or my case below: >>> (1) S-C-n >>> (2) C-@ C-n >>> it's very confusing that they behave differently as to >>> selection. And, once we get used to that C-@ make Emacs own selection, we'll do your task in this order: "Set mark in Emacs, select a lot of code, paste it in Emacs, ...". Or, we can have something like this single command (don't take the code itself and the key-binding seriously). (defun mouse-yank-primary-and-select (click) (interactive "e") (mouse-set-point click) (push-mark) (mouse-yank-primary click)) (global-set-key [S-C-mouse-2] 'mouse-yank-primary-and-select) Though, please note that I myself still think it's better to modify command_loop_1 than chaning C-@ to own selection. --- Kenichi Handa handa@m17n.org