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: Thu, 7 Feb 2008 20:39:22 +0000 Message-ID: <8e24944a0802071239r1cdc8affq7875fea0b9876560@mail.gmail.com> References: <8e24944a0802030512t77c4ca20s6d059df50295ebd2@mail.gmail.com> <8e24944a0802041302n45064c4fm2ac428ceda204254@mail.gmail.com> <47A80B57.3050402@swipnet.se> <8e24944a0802061957re4baf7cr9560fa3496be56b4@mail.gmail.com> <8e24944a0802070815n18dea273j5c3962235d91ca8e@mail.gmail.com> <87bq6sir34.fsf@uwakimon.sk.tsukuba.ac.jp> <8e24944a0802071022i2b259c5fka14f191a3c519157@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 1202416786 15261 80.91.229.12 (7 Feb 2008 20:39:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Feb 2008 20:39:46 +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 Thu Feb 07 21:40:04 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 1JNDXJ-0002n9-Qj for ged-emacs-devel@m.gmane.org; Thu, 07 Feb 2008 21:39:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNDWr-0002Pq-59 for ged-emacs-devel@m.gmane.org; Thu, 07 Feb 2008 15:39:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JNDWn-0002PZ-DV for emacs-devel@gnu.org; Thu, 07 Feb 2008 15:39:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JNDWm-0002PI-RA for emacs-devel@gnu.org; Thu, 07 Feb 2008 15:39:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNDWm-0002PF-L6 for emacs-devel@gnu.org; Thu, 07 Feb 2008 15:39:24 -0500 Original-Received: from qb-out-0506.google.com ([72.14.204.238]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JNDWm-00052Y-8p for emacs-devel@gnu.org; Thu, 07 Feb 2008 15:39:24 -0500 Original-Received: by qb-out-0506.google.com with SMTP id e6so6113838qbe.2 for ; Thu, 07 Feb 2008 12:39:23 -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=zD9C9MFmRb+zcm9VAcFsnhr/khp/ejqe0gsM2im8fys=; b=AGmncTzHLuMkSoFNFQA4twnWXNjCQyHKhMdS7ojY8w2nP6JOApqjUHhQWLHYzJkk945Alu8zkT1arG8S2rVYJKPpLZMPTTBRsa9KQ+u5ovEl8QD/Jjbm9zbRlLJvB7Y/V3NOPYHJLxMKxMm1OponVmTJMcDLgtn9mGkUaSqgwdk= 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=BQ5kblq+LT0m0ny7Z1kC/wo9P5GcKfwDUggs7EmacgR+5jBiDFPJYqI51ubf44A6+4GakJUF4aOK9Oy+dhBEJu2CfGNrsSZyQAASNIxgTLFqvO7wAPdCFIVkPjaOj12qismo9EMdotkCWUOX4G9DdwxZyAerfazHHqiOegNTtbc= Original-Received: by 10.142.84.3 with SMTP id h3mr6572474wfb.113.1202416762244; Thu, 07 Feb 2008 12:39:22 -0800 (PST) Original-Received: by 10.142.111.4 with HTTP; Thu, 7 Feb 2008 12:39:22 -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:88457 Archived-At: On 07/02/2008, Stefan Monnier wrote: > The name "interprogram-highlight-function" sounds wrong: the user does > not highlight the text, she selects it (the highlighting is done by the > application to help the user figure out what is selected). So I suggest > `interprogram-select-function' for it. I thought of that, but wanted to avoid "select" because of its X11 usage: that which is cut is also a selection in X11 terms. Still, it's not terrible, and fits in with select-active-regions. N.B. interprogram-highlight-function is used only when select-active-regions is active. > For the last one, I suggest we > use `interprogram-insert-function', tho I'm not completely sure > I understand what it's intended to do. It is intended to be for inserting texts retrieved from the window system which are to be inserted without side-effecting the kill ring. It is only used in the very specific case of (the patched) mouse-yank-at-click with mouse-yank-at-click set to lightins rather than yank. Remember, the goal is allow a configuration where primary /never makes its way into the kill ring/, while still allowing its insertion with middle-click. If you're a long-time emacs user used to (or given the audience, partially responsible for!) existing behaviour, you're probably now wondering why the heck you want that - fortunately for you, patch defaults to existing behaviour. > From what I can tell, there are 4 kinds of selections: > - C-SPC + mouse movement. I.e. select-only. > - 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". > I also believe that the use of CLIPBOARD for 2 and 3 depends on > x-select-enable-clipboard. Yes. > You're suggesting to allow PRIMARY for No 1 via `select-active-regions'? > Oh, I see it already exists, so you're just trying to fix it so it > works more reliably, is that right? > Yes (and making it not x-specific.). > 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! If mouse-drag-copy-region is on (the default), then mouse-selecting uses the the kill ring and side-effects the X11 selection via interprogram-cut-function, so select-active-regions is not necessary. But if mouse-drag-copy-region is off (so mouse-selecting doesn't affect the kill ring, only mouse-selecting then killing...), then select-active-regions is necessary (for mouse AND keyboard) to propagate out to primary. > On the lighins side, I understand even less why there's a need for > interprogram-highlight-insert-function. We have 3 different situations: > - C-y > - mouse-2 > - "Paste" from the menu > > For all three cases, the first question is "where does the text come from": > No 3 should always use the CLIPBOARD then PRIMARY then kill ring. [I'd say it should always use CLIPBOARD then kill ring, never PRIMARY, it should just do a yank, which via current-kill may pull in CLIPBOARD) > No 2 should use the CLIPBOARD only if x-select-enable-clipboard is set. ... but *not* add to kill ring! (unless the user wants it to) No 1 IS a yank, (which via current-kill/interprogram-paste-function) may pull in CLIPBOARD. > thus integrating the kill-ring with the > PRIMARY/CLIPBOARD even more tightly). Hmm. May have to think through your last part more, but just to stress, my goal is to allow at least one point in the customization space that: 1. totally separates x11 primary and the kill-ring, 2. unifies x11 clipboard and kill-ring. 3 while still allowing get (by middlebutton-insert) and set (by keyboard or mouse selection leading to highlight) of primary.