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.devel Subject: Re: Improving X selection? Date: Fri, 8 Feb 2008 02:50:44 +0000 Message-ID: <8e24944a0802071850o2920041cw9de2f27c59f90148@mail.gmail.com> References: <47A80B57.3050402@swipnet.se> <8e24944a0802061957re4baf7cr9560fa3496be56b4@mail.gmail.com> <8e24944a0802070815n18dea273j5c3962235d91ca8e@mail.gmail.com> <87bq6sir34.fsf@uwakimon.sk.tsukuba.ac.jp> <8e24944a0802071022i2b259c5fka14f191a3c519157@mail.gmail.com> <8e24944a0802071239r1cdc8affq7875fea0b9876560@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1202439060 15213 80.91.229.12 (8 Feb 2008 02:51:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Feb 2008 02:51:00 +0000 (UTC) Cc: "Horsley, Tom" , "Stephen J. Turnbull" , "Jan D." , rms@gnu.org, emacs-devel@gnu.org To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 08 03:51:21 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JNJKj-0000dV-G9 for ged-emacs-devel@m.gmane.org; Fri, 08 Feb 2008 03:51:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNJKG-0004hs-SD for ged-emacs-devel@m.gmane.org; Thu, 07 Feb 2008 21:50:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JNJKC-0004fM-Cl for emacs-devel@gnu.org; Thu, 07 Feb 2008 21:50:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JNJKA-0004eH-UI for emacs-devel@gnu.org; Thu, 07 Feb 2008 21:50:47 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNJKA-0004eE-P8 for emacs-devel@gnu.org; Thu, 07 Feb 2008 21:50:46 -0500 Original-Received: from qb-out-0506.google.com ([72.14.204.228]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JNJKA-00078y-96 for emacs-devel@gnu.org; Thu, 07 Feb 2008 21:50:46 -0500 Original-Received: by qb-out-0506.google.com with SMTP id e6so6215544qbe.2 for ; Thu, 07 Feb 2008 18:50:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=n2RJFjGW2u6R68uY1yIkUf+b3+z3GIQVuYS0C8JouWE=; b=mS+HEGuB9U70kqY62dqWEnhhUp1avW0RF8cZRJFAQl0OjMsmAyIb+teEG/JUNkNddZ/T28qw9Os8gRHYchSKJj1W19jp27RzGgstZgDNgPZlfzOApUzz9EGSgRxyhD3blKkgdJO9vKUQSMSNvu208yv8C2rwrvHmj0Dl6Dwrav4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=OyyMk+ZaxxZPRCjFEEWWGnKipXIEwdSYjFO9fCX1VuZVeRWf93+CaFq2p/a0xw0ZODsz0YzxI34R5TIGRuqY/1nidPbOj6BvGKjBZqkGMcrJPrZDaNmhl9mxmJTJxY/QnkmXFJEW9yNv9s0mNq1mfx/9LwWDRFMgLf3uhkBlJJU= Original-Received: by 10.142.246.8 with SMTP id t8mr6652281wfh.199.1202439044690; Thu, 07 Feb 2008 18:50:44 -0800 (PST) Original-Received: by 10.142.111.4 with HTTP; Thu, 7 Feb 2008 18:50:44 -0800 (PST) In-Reply-To: Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:88487 Archived-At: On 07/02/2008, Stefan Monnier wrote: >> From what I can tell, there are 4 kinds of selections: > >> - C-SPC + mouse movement. I.e. select-only. > ^^^^^ > cursor > Duh! > > >> - same plus C-w. > >> - selection with the mouse. > >> - one of the above plus "copy" from the menu. > >> > >> No 4 should always use the CLIPBOARD. > >> No 3 should always use the PRIMARY (plus optionally CLIPBOARD) > >> No 2 may optionally use PRIMARY (plus optionally CLIPBOARD) > >> No 1 should use neither or at most PRIMARY. > >> > >> I believe that currently No 2 and No 3 are always handled in the same > >> way, and I don't know if we want to bother separating them. > > > I'm not 100% sure what you meant by "selection with mouse" there : > > No 1 covers "selection [only] with mouse". > > Yes, sorry, the "mouse movement" above was a typo. > Okay, your 2. and 3. are already not necessarily handled the same way in existing emacs - mouse-drag-copy-region nil exists to make mouse-drag selection act like 1 only with the mouse. [Aside: Part of the patch was just to make a setting for mouse-save-then-kill (mouse-3) analogous to mouse-drag-copy-region for mouse-drag... - mouse-save-then-kill-copy-region. Like a standalone fix for select-active-regions, it could be a standalone thing applied independent of rest of patch] So, by setting mouse-drag-copy-region to nil and select-active-regions to t, and sending to CLIPBOARD and kill ring for C-w and to PRIMARY in select-active-regions, outgoing freedesktop.org compliant behaviour can be achieved while unifying the clipboard and kill ring. > >> Why do you need `interprogram-highlight-function'? Can't you just use > >> > >> (let ((x-select-enable-clipboard nil)) > >> (kill-ring-save beg end)) > >> > >> like clipboard-kill-ring-save does? > > > No, that would affect the kill ring! > > Then add x-select-enable-kill-ring. Big deal. > Do you mean as a customization telling select-active-regions not to use kill-ring-save but rather its own call to interprogram-cut-function with the locally rebound x-select-enable-clipboard*? Or telling kill-ring-save to not use the kill ring (heh)? *And, er, then what if the heretic freedesktop.org-scorning user /wants/ selection to affect the clipboard, like an xterm with "select to clipboard" turned on? The patch handles that situation fine. I still think an interprogram-select/insert-function is simpler. Selection and insertion are plain different interprogram operations to cut/copy and paste after all. In fact, outside X11, they're not even interprogram operations.