From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Need help with emacs clipboard. Date: Fri, 30 Jan 2015 20:18:37 -0700 Message-ID: <20150129185746715118144@bob.proulx.com> References: <20150113212722522787447@bob.proulx.com> <877fwah3p7.fsf@robertthorpeconsulting.com> Reply-To: help-gnu-emacs@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1422674352 26190 80.91.229.3 (31 Jan 2015 03:19:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 Jan 2015 03:19:12 +0000 (UTC) Cc: cplum984@gmail.com To: help-gnu-emacs@gnu.org, Robert Thorpe Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 31 04:19:07 2015 Return-path: Envelope-to: geh-help-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 1YHOaQ-00034V-6K for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Jan 2015 04:19:06 +0100 Original-Received: from localhost ([::1]:39538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHOaP-0005SG-4E for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Jan 2015 22:19:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHOa9-0005SB-1f for help-gnu-emacs@gnu.org; Fri, 30 Jan 2015 22:18:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHOa3-00014i-E9 for help-gnu-emacs@gnu.org; Fri, 30 Jan 2015 22:18:48 -0500 Original-Received: from joseki.proulx.com ([216.17.153.58]:43397) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHOa2-00013l-Pn for help-gnu-emacs@gnu.org; Fri, 30 Jan 2015 22:18:43 -0500 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 0314C2182C; Fri, 30 Jan 2015 20:18:38 -0700 (MST) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id D65D62DC42; Fri, 30 Jan 2015 20:18:37 -0700 (MST) Mail-Followup-To: help-gnu-emacs@gnu.org, Robert Thorpe , cplum984@gmail.com Content-Disposition: inline In-Reply-To: <877fwah3p7.fsf@robertthorpeconsulting.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102392 Archived-At: Robert Thorpe wrote: > Bob Proulx writes: > > I see exactly the opposite behavior. Emacs by default uses the > > clipboard for cut-and-paste. But on my system nothing else uses the > > clipboard as Firefox and Chromium both use the X primary selection. > > I think you're misunderstanding how things have changed. The idea of > introducing the clipboard into X was to make things more like Windows. > The old x-selection behaviour is still supported though. I think you are misunderstanding my response. :-) But I agree with you that the idea of the clipboard is more like MS-Windows. I think the issue lies in the definitions of cut-n-paste. There are at least three ways to perform those actions and the result expected depends at least somewhat upon which way they are performed. 1. Click and hold mouse-1, drag, release. Text is highlighted and placed into the primary selection. Click mouse-2. Primary selection is pasted as input. Generally everywhere but in Emacs v24 this was changed to use the clipboard by default instead of the primary selection. 2. Use an application that is configured for the Microsoft interface such as pretty much any graphical browser these days. Highlight text using mouse-1 click, drag, and release. Use C-c (or C-x) to copy (or cut) the text into the clipboard. Paste using C-v. 3. Emacs graphical interface specifically interacts with the primary selection and clipboard to place text killed with kill-region C-w and kill-ring-save M-w into the primary selection in v23 and earlier or into the clipboard in v24 and later. This is configurable using the previously mentioned emacs configuration variables. If you are a Microsoft type of person then you probably ignore #1 and always use method #2 in which case you want emacs to interact with the clipboard and therefore want the new v24 and later behavior. If you are an X Window System type of person then you want to ignore #2 and use #1 in which case you want Emacs v23 and earlier behavior not v24 and later. > This is how things work on my system (Xubuntu). If I mark something > with the mouse in Firefox, Thunderbird or Libreoffice then it enters the > x-selection. If I then press the middle mouse button in Emacs it's > pasted into the Emacs buffer. That's the old x-selection behaviour in > action. Yes. Agreed. Same here. Which is what I had said before. This would be the interface that I define and describe as #1 above. This is the way The X Window System works. Chromium, Firefox, Libreoffice, others all behavior this way under The X Window System. However I think something has changed again in Emacs v24. Because with an earlier version middle mouse-2 paste would paste from the clipboard by default (emacs -Q) which was much of my complaint but now it is back to pasting from the primary selection. Something was fixed. Yay! > If I mark something *and then "copy" or "cut" it*, then it enters the > clipboard. I assume that when you say the "*and then ..." part you are talking about using the Microsoft CUA keys C-w, C-x, C-v. That is what I define and describe as #2 above. That is the way Microsoft works. And by extension many X applications also support this because of the many Microsoft refugees that arrive from there. Note that in your words "If I mark something" that at that time it has already been placed into the primary selection using the X Window System behavior. You can immediately paste that with the mouse middle button. When you then use C-c or C-x then that places it into the clipboard using the Microsoft behavior. > So, if I mark something and then press Ctrl-C in Libreoffice > it enters the clipboard. Then I can press C-y in Emacs and it will yank. Note that C-y in Emacs will reference the emacs configuration to paste either from one or the other depending upon the variable settings. In Emacs v23 and earlier a graphical emacs interface would paste from the primary selection. In v24 and later it pastes from the clipboard by default. > So, when you do the Ctrl-C in the other app the x-selection and the > clipboard contain the same information. Yes. Agreed. > If I mark something different then the x-selection changes but the > clipboard doesn't. This is actually useful because it means you can > carry two independent bits of text from another app into Emacs without > having to visit the app twice. Yes. And let me applaud you for knowing this at that level of detail and making use of it. Very good! I place that knowledge right there with knowing about the kill-ring and being able to rotate through it. Very useful knowledge. And mixed in there is also the secondary selection too. See (apropos "mouse-.*-secondary") for a list. > Apparently Chromium's behaviour is buggy though, see: > https://code.google.com/p/chromium/issues/detail?id=68886 I don't see those issues every day but I have tripped over them on occasion. Ashame that after several years and many releases those issues are not fixed yet. Bob