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#8996: Set PRIMARY from last selection, not last selected window Date: Sun, 25 Mar 2012 14:42:14 +0100 Message-ID: <4F6F20B6.6090904@harpegolden.net> References: <4E121079.6020103@harpegolden.net> <8739illrkc.fsf@stupidchicken.com> <4E169B83.4050706@harpegolden.net> <4E1A6689.1040203@harpegolden.net> <87pqc2b6f6.fsf@gnu.org> <4F6E91DB.30200@harpegolden.net> <87iphtwdmc.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1332682985 24720 80.91.229.3 (25 Mar 2012 13:43:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 25 Mar 2012 13:43:05 +0000 (UTC) Cc: 8996@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 25 15:43:04 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SBnip-0000kg-E4 for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Mar 2012 15:43:03 +0200 Original-Received: from localhost ([::1]:59708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBnio-0000b6-Mk for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Mar 2012 09:43:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBnil-0000ab-RG for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2012 09:43:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBnik-0006Xc-11 for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2012 09:42:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBnij-0006XV-Tc for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2012 09:42:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SBoCn-0002AD-Hw for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2012 10:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David De La Harpe Golden Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Mar 2012 14:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8996 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8996-submit@debbugs.gnu.org id=B8996.13326848188273 (code B ref 8996); Sun, 25 Mar 2012 14:14:01 +0000 Original-Received: (at 8996) by debbugs.gnu.org; 25 Mar 2012 14:13:38 +0000 Original-Received: from localhost ([127.0.0.1]:38349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBoCQ-00029O-0o for submit@debbugs.gnu.org; Sun, 25 Mar 2012 10:13:38 -0400 Original-Received: from harpegolden.net ([65.99.215.13]:44707) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBoC9-000292-HH for 8996@debbugs.gnu.org; Sun, 25 Mar 2012 10:13:36 -0400 Original-Received: from [87.198.47.36] (87-198-47-36.ptr.magnet.ie [87.198.47.36]) (using TLSv1 with cipher 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 18A81683CF; Sun, 25 Mar 2012 14:42:15 +0100 (IST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 In-Reply-To: <87iphtwdmc.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58126 Archived-At: On 25/03/12 04:42, Chong Yidong wrote: > David De La Harpe Golden writes: > >> Well, that only catches cases that happen owing to things that trigger >> the event that handle-select-window is bound to. >> >> But that event isn't fired when you C-x o - other-window just straight >> calls the select-window function. So, with your patch applied, it >> probably fixes the visible issue in Stefan's focus-follows-mouse case, >> but my keyboard recipe previously given still yields the "wrong"* >> selection. > > OTOH, keyboard commands stealing the selection seems a little less > problematic, because the user is specifically doing an Emacs command > rather than just moving the mouse. I'm not sure it's wrong for C-x o to > get the selection if the window switched to has an active region. Hmm, well, subjectively it did feel wrong to me, it is after all the context I spotted the issue in. But I'm now presumably also influenced by months of using my locally munged emacs. In terms of current practice of one of our "competitors" (loosely) that has fairly similar functionality, kde kate, it does _not_ appear to reset x11 primary to the older but still visibly highlighted region when you just switch between windows, even with the keyboard (of course it doesn't use emacs terminology for the entities in question, but functionally similar), it sticks to the temporal order: launch kate, enter a new session enter "The quick brown fox jumps over the lazy dog." hit Ctrl-Shift-T (split window) select (shift-arrow keys) "fox" in window #1 hit F8 (switch window) select (shift-arrow keys) "dog" in window #2 hit F8 (switch window) -> current window #1 again, and has "fox" region still visibly highlighted (and it is again current in terms of intra-kate ops like overtyping it) hit mouse-2 -> "dog" is inserted from primary. In gvim, given modality there are probably too many differences for the comparison to be fair, anyway it doesn't reset primary to the older (and unlike emacs/kate, not visible anyway) region when you switch windows. Visible region highlighting apparently disappears once you exit visual mode, so the question of visual vs. temporal correspondence that arises in emacs/kate is irrelevant, temporal is the natural option. Visual mode seems to be exited when you switch windows to a window onto a different buffer, it's only maintained if both windows are onto the same buffer and in which case they apparently have the same visual region, so the same-buffer/different-window/different-visible-region case of emacs or kate probably can't arise (not a vim expert, mind).