From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: Copy Paste in no-x11 mode (emacs -nw) Date: Fri, 26 Sep 2008 11:02:09 +0200 Message-ID: <87od2bp9f2.fsf@tux.homenetwork> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222420007 26465 80.91.229.12 (26 Sep 2008 09:06:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Sep 2008 09:06:47 +0000 (UTC) Cc: Simeon Nifos , help-gnu-emacs@gnu.org To: Nikolaj Schumacher Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 26 11:07:45 2008 connect(): Connection refused 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 1Kj9Id-0000Jd-UT for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Sep 2008 11:07:44 +0200 Original-Received: from localhost ([127.0.0.1]:32827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kj9Hb-0004PS-Js for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Sep 2008 05:06:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kj9Gp-0004PK-Q1 for help-gnu-emacs@gnu.org; Fri, 26 Sep 2008 05:05:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kj9Gn-0004OV-R2 for help-gnu-emacs@gnu.org; Fri, 26 Sep 2008 05:05:51 -0400 Original-Received: from [199.232.76.173] (port=49403 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kj9Gn-0004OK-MU for help-gnu-emacs@gnu.org; Fri, 26 Sep 2008 05:05:49 -0400 Original-Received: from ik-out-1112.google.com ([66.249.90.179]:4752) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kj9Gn-0003yx-De for help-gnu-emacs@gnu.org; Fri, 26 Sep 2008 05:05:49 -0400 Original-Received: by ik-out-1112.google.com with SMTP id c21so590658ika.2 for ; Fri, 26 Sep 2008 02:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=KlrAFxzCdm7Jtjk8Vkv9Ceaa7ooV1XeWLX42JIf8aeA=; b=LvwCjhbNn7sJRZ2R/Ei6uXVvA/PH+OWbIBlHYyFxUjc8XRsGYt1czQPYJWhrQlK+Hs xFfqMPpj8hD9SXQEM7AvtxBnGM43B930EZePnaUsEoyRift9jF194u1DgNmcVBGAbpXu iKm7BETfznDVgf4TSIwHzNwE0an35p0Fbo5UM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=nAgSD9ppu5p4N1PtpFC2jh1FQrA5j1gGdD6rxRVM7Y48aL6tsiiOSPy1SQR2xFo1KJ LMO2X6x9egR0u89Bl12rkj3rVb6eTfj6NtiOiSAtjW7CSzjNtoncIQGgWttQod5nzJvF anRzlyiJqvomiLTL3ZNzUUsN6kdWyQPQAHtyY= Original-Received: by 10.210.17.2 with SMTP id 2mr1176092ebq.6.1222419947997; Fri, 26 Sep 2008 02:05:47 -0700 (PDT) Original-Received: from tux.homenetwork ( [77.197.77.9]) by mx.google.com with ESMTPS id d23sm9675603nfh.11.2008.09.26.02.05.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 26 Sep 2008 02:05:46 -0700 (PDT) In-Reply-To: (Nikolaj Schumacher's message of "Fri, 26 Sep 2008 10:17:44 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:58099 Archived-At: Nikolaj Schumacher writes: > "Simeon Nifos" wrote: > >>> "Simeon Nifos" writes: >>> >>>> Dear list, >>>> I like using emacs in nox11 mode. The Eterm terminal provides a great >>>> font by default I really enjoy. It is smaller and I can work on more >>>> source code than I do with the misc-fixed font of Xterm. So I usually >>>> run emacs with -nw. > > Please note that running without -nw is very different from running in > Xterm. I'm not sure if you're clear on that (based on that sentence). > > Running it in X gives you a very configurable appearance, including free > choice of font and size. > >>>> This is a real headache, since one of the most foundamental stuff an >>>> editor is supposed to do, is to support copy and paste of text from >>>> whatsoever source to the window where editing takes place. >>> >>> No. >> >> Really? Why not? Why so fundamental things which is common sense >> are so easilly thrown into trash from Unixers? > > I think he was not saying that Emacs shouldn't do it, but that Emacs > can't do it. When you copy from "whatsoever" source, you copy using it > using X, right? But since Emacs runs in a terminal, it doesn't have > access to X, only the terminal has. It is all abstracted away by the > terminal. > > Now, terminals generally support copy & paste with the regular Ctrl+c > and Ctrl+v shortcuts (sometimes Ctrl+Shift+c). They then pass this text > to the program (Emacs) as input. Emacs has no way of knowing that this > was pasted, not entered on the keyboard. > >>> Copy/Paste is a function of the terminal, not Emacs, when you run >>> Emacs in a terminal. >> >> Hmmm, it seems however that VIM does it. I am working on the same >> Eterm, terminal with VIM and the same thing works like a charm. Why >> shouldn't it work with the famous EMACS as well? > > What are you using to paste in vim. "p"? To my knowledge that > shouldn't work, either. (And doesn't, on my machine.) > >> Can you? I am using Linux. But the same holds for FreeBSD, Solaris. >> Look what I get when I try to paste something on the terminal where >> EMACS runs; I mean paste something outside emacs from another >> emacs window or vim window or the browser. This is what is reported >> down in the command-buffer: "Kill ring is empty" > > As I said above, Emacs can't get access to the X clipboard. Only the > terminal can. You can use your terminal's paste function, if it has > one, though. > If you use screen, you can copy from there just like in emacs: Assume screen prefix key is C-p: (default is C-a) C-p [ ==> SPC ==> C-f or/and C-n ==> > Now you have a copy of the text in a file named ~/.screen_exchange to set it, write in your .screenrc: ,---- | bufferfile $HOME/.screen_exchange `---- Note: i think the default if you set nothing is /tmp/.screen_exchange but i am not sure. Now if you define a little function with a global-key like: ,---- | (defun tv-yank-from-screen () | (interactive) | (insert-file-contents "~/.screen_exchange")) | | (global-set-key (kbd "C-c Y") 'tv-yank-from-screen) `---- you can now yank what you want from your terminal :) -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France