From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Improving X selection? Date: Thu, 07 Feb 2008 14:45:46 -0500 Message-ID: References: <8e24944a0802030338i1ce3397yba581ffedbe2f118@mail.gmail.com> <47A5B737.8000804@swipnet.se> <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=us-ascii X-Trace: ger.gmane.org 1202413587 3302 80.91.229.12 (7 Feb 2008 19:46:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Feb 2008 19:46:27 +0000 (UTC) Cc: "Horsley, Tom" , "Stephen J. Turnbull" , "Jan D." , rms@gnu.org, emacs-devel@gnu.org To: "David De La Harpe Golden" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 07 20:46:46 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 1JNChi-0006so-CP for ged-emacs-devel@m.gmane.org; Thu, 07 Feb 2008 20:46:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNChD-0006Qn-Eo for ged-emacs-devel@m.gmane.org; Thu, 07 Feb 2008 14:46:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JNChA-0006Qe-En for emacs-devel@gnu.org; Thu, 07 Feb 2008 14:46:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JNCh6-0006Px-VG for emacs-devel@gnu.org; Thu, 07 Feb 2008 14:46:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNCh6-0006Pu-Pl for emacs-devel@gnu.org; Thu, 07 Feb 2008 14:46:00 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JNCh3-00085O-BH; Thu, 07 Feb 2008 14:45:57 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 878012CF53B; Thu, 7 Feb 2008 14:45:54 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 374A83FE0; Thu, 7 Feb 2008 14:45:46 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 23BB26CAA0; Thu, 7 Feb 2008 14:45:46 -0500 (EST) In-Reply-To: <8e24944a0802071022i2b259c5fka14f191a3c519157@mail.gmail.com> (David De La Harpe Golden's message of "Thu, 7 Feb 2008 18:22:07 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:88448 Archived-At: > Would be nice to find one that didn't induce an extra hyphen is all - > interprogram-cut-function > interprogram-paste-function > interprogram-highlight-function > interprogram-highlight-insert-function 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. 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. The following is some random analysis of the situation, for my own good. >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 also believe that the use of CLIPBOARD for 2 and 3 depends on x-select-enable-clipboard. 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? 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? 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. No 2 should use the CLIPBOARD only if x-select-enable-clipboard is set. No 1 is identical except it may also not check PRIMARY either. In all 3 cases a further question is: if the yanked text comes from the CLIPBOARD or the PRIMARY, should the text be added to the kill-ring? This last question is the one you seem to want to address, but I don't see why you need interprogram-highlight-insert-function for it, instead of just a boolean config var. And to be honest: I doubt that there's enough of a need for this level of control to justify its introduction; it's easy enough to use M-y to get back to the previous item. This said, if we introduce such a "copy-interprogram-text-to-kill-ring" config var, we could give it 3 values: either the kill-ring is never affected, or the kill-ring is filled from CLIPBOARD/PRIMARY upon yank, or the kill-ring is not only filled upon yank but also upon kill (that's a patch I suggested a few months back: before pushing something to the CLIPBOARD/PRIMARY, check the previous value, and if it's not ours, stash it in kill-ring, thus integrating the kill-ring with the PRIMARY/CLIPBOARD even more tightly). Stefan