From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jeremy Maitin-Shepard Newsgroups: gmane.emacs.devel Subject: Re: Improving X selection? Date: Mon, 15 Oct 2007 15:26:53 -0400 Message-ID: <87fy0cdvr6.fsf@jbms.ath.cx> References: <20071012105022.6c8b174a@tweety> <874pgtfw1y.fsf@jbms.ath.cx> <4713067D.2060504@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1192479890 2844 80.91.229.12 (15 Oct 2007 20:24:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Oct 2007 20:24:50 +0000 (UTC) Cc: tom.horsley@ccur.com, Jan =?utf-8?Q?Dj=C3=A4rv?= , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 15 22:24:40 2007 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 1IhVb1-0003wh-0N for ged-emacs-devel@m.gmane.org; Mon, 15 Oct 2007 21:27:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IhVau-0005f4-26 for ged-emacs-devel@m.gmane.org; Mon, 15 Oct 2007 15:27:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IhVaq-0005et-Q4 for emacs-devel@gnu.org; Mon, 15 Oct 2007 15:27:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IhVap-0005eX-8q for emacs-devel@gnu.org; Mon, 15 Oct 2007 15:27:12 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IhVap-0005eU-4U for emacs-devel@gnu.org; Mon, 15 Oct 2007 15:27:11 -0400 Original-Received: from smtp.andrew.cmu.edu ([128.2.10.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IhVag-0001ad-4Q; Mon, 15 Oct 2007 15:27:02 -0400 Original-Received: from localhost (JBMS.WV.CC.cmu.edu [128.237.231.148]) (user=jmaitins mech=GSSAPI (0 bits)) by smtp.andrew.cmu.edu (8.13.8/8.13.8) with ESMTP id l9FJQraN025229 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 15 Oct 2007 15:26:53 -0400 In-Reply-To: (Richard Stallman's message of "Mon\, 15 Oct 2007 14\:30\:49 -0400") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.990 (gnu/linux) X-Habeas-SWE-9: mark in spam to . X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-1: winter into spring X-Scanned-By: MIMEDefang 2.60 on 128.2.10.212 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:80958 Archived-At: Richard Stallman writes: > The change, if any, I'd like is that C-y and M-w operates on CLIPBOARD, and > that PRIMARY is left to mouse operations. > ISTR that there are environments where it is bad to use the clipboard > at all. I don't remember what they are -- are there people that don't > use the clipboard at all? > Also, the basic idea seems mistaken. When I select something in > another program, I select it with the mouse because that's the only > way. That doesn't mean I should only be able to grab it in Emacs with > the mouse. C-y should work. This is precisely the reason I am currently unsatisfied with the Emacs selection handling. I never use the mouse or toolbars in Emacs, but in some programs (most notably terminal emulators like xterm) I have to use the mouse to select text. I'd like there to be some convenient way to paste either the PRIMARY selection or the CLIPBOARD selection using only keyboard commands. Currently, setting `x-select-enable-clipboard' to t (the way to get Emacs to sometimes paste from the clipboard with C-y) has a rather serious problem: the behavior of C-y becomes unpredictable, because it uses an unreliable heuristic. Specifically, it attempts to determine which of the PRIMARY or CLIPBOARD selections is newer. Unfortunately, because it doesn't poll constantly, it has no way of actually determining this, and instead just chooses the one that changed since Emacs last checked, and prefers the clipboard if both have changed. In practice, much of the time that I am trying to paste something from another program, both selections have changed since Emacs last checked, so effectively it always chooses the clipboard, which means that pasting from terminals does not work well. It seems that at the very least this unreliable heuristic in Emacs should be replaced by something better, because I can't see how it is very useful for anyone. If it is left in, there should at least be a way to choose alternative behavior (like "only use the clipboard"). Perhaps the only real solution for me is to write a program that effectively copies the text in PRIMARY to the CLIPBOARD, and bind this program to some key like mod4-y. -- Jeremy Maitin-Shepard