From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Copying text from emacs to another application using M-w Date: Wed, 23 Sep 2009 18:26:57 +1000 Organization: Rapt Technologies Message-ID: <87y6o66p7y.fsf@lion.rapttech.com.au> References: <87iqfe8dkw.fsf@lion.rapttech.com.au> <87ab0o91bp.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253695293 3539 80.91.229.12 (23 Sep 2009 08:41:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Sep 2009 08:41:33 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 23 10:41:26 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MqNPe-0001bP-Lz for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Sep 2009 10:41:23 +0200 Original-Received: from localhost ([127.0.0.1]:44201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqNPd-0004Ri-P8 for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Sep 2009 04:41:21 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!news.glorb.com!news2.glorb.com!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:bciUimCcBB7Z0Hi4xVCpdGS++Y4= Original-Lines: 103 Original-NNTP-Posting-Host: 90603181.news.astraweb.com Original-X-Trace: DXC=0ImFRCCBnEUkR1VMS3E6>\L?0kYOcDh@ZMIPGNlI[_GQ8P?8[VnF4CWL?:=ZL5GW@XEPWl7RJ6AJX Original-Xref: news.stanford.edu gnu.emacs.help:173292 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:68412 Archived-At: Harry Putnam writes: > Tim X writes: > >>> Tim do you mind posting how you do the other way round. >>> >>> I mean copy outside emacs. Paste inside emacs. >>> I keep getting really goofed up when I try that. Seems to take >>> several attempts before the paste will happen. >>> >>> I probably have something set wrong somewhere. But it seems like the >>> last copy/kill in emacs is what keeps sticking to clipboard or kill ring or >>> somewhere I don't want it. So that when I press middle mouse or C-y >>> to paste into emacs... I get something from an earlier operation. >>> >>> I'd like to do this: >>> >>> 1. Mouse or keyboard (or C-a) select a region or `all' (say in firefox) >>> 2. Middle mouse or C-y to paste that region into emacs. >>> done >>> >> >> That is essentially what I do. I just tested it with firefox. >> >> 1. Started firefox >> 2. Using the mouse, highlighted the region of interest. >> 3. Switched to emacs >> 4. click mouse 1 to position the cursor where I want the data to be >> pasted, theen hit the middle mouse button to paste it. >> >> Most of the time, when back in emacs, I wouldn't use the mouse, C-y >> pastes the selection as well. >> >> I don't have any special settings in my .emacs relating to this and I >> don't use CUA mode. Currently running emacs 23 on Debian unstable. > > Here is an example of the kind of thing that keeps aggravating me. > > I've run a search with homemade grepping tool in an Xterm window > The search results are printing to screen and running off the viewing > area. > > I scroll backup up the xterm buffer and find a file name I want to > open. > > Highlight the filename (in xterm buffer) by dragging with left mouse. > In emacs I have done C-x C-f and have the command waiting at the > command prompt for a filename. > > Now shift mouse from xterm to emacs window and C-y with emacs. > > Whoops it pastes something from a different virtual desktop that was > the last thing copied in a separate instance of emacs running there. > > Ok... try it all again: shift mouse back to xterm again left mouse > drag to highlight the filename. shift to emacs left click to bring > focus to command prompt in emacs .. C-y to paste... whoops again > I get the same item from an earlier copy in a separate instance > of emacs. > > Now a third attempt of the same procedure: shift mouse to xterm, left > drag to highlight filename ... shift mouse back to emacs and finally > on the third attempt C-y pastes what I copied from the xterm with > mouse. > > Very aggravating... the earlier copy seems stuck to C-y or right click > for several attempts... and finally the copy/paste works. > Hi Harry, when I read your post of how your working, I thought maybe there are some 'different' key bindings in the mini-buffer. I sometimes get bitten in a similar way when using i-search and you want to paste in something you have highlihgted as the search string - I then realised I needed to use M-y rather than C-y in that situation. So, I tried your exact scenario. I am sorry to report that I could not reproduce your problem. It worked perfectly for me each time, regardless of whether I used the keyborad or the mouse. I first did a simple ls listing in an xterm, highlighted one of the files in the listing and pasted that as the file to open with C-x C-f. I tried it both with C-x C-f already waiting for input and with issuing the command after doing the highlighting of the file to use. I then did a grep for a patter and got a list of different files with that pattern, selected one of the files with the mouse in the xterm and tried pasting it as the argument to open file, but cold not reproduce your issues. All worked fine for me. Are you using anything like ido, icycles etc? I'm stock standard out of the box with none of the 'advanced' enhancements to the mini-buffer. I'm also using a real three button mouse, not one with 2 buttons set to emulate a 3 button one. I also cut from an xterm rather than some other terminal emulator, like gnomre-terminal (I'm not saying this means anything, just trying to eliminate possible differences between our setup). I'm also running a recent CVS build (about 5 days old) of emacs 23. I do not have any settings in my .emacs relating to clipboard or anything else - all at default values. I am running emacspeak and it is possible it has modified something I'm not aware of. Tim -- tcross (at) rapttech dot com dot au