[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copy Paste in no-x11 mode (emacs -nw)

From: Thierry Volpiatto
Subject: Re: Copy Paste in no-x11 mode (emacs -nw)
Date: Fri, 26 Sep 2008 11:02:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Nikolaj Schumacher <address@hidden> writes:

> "Simeon Nifos" <address@hidden> wrote:
>>> "Simeon Nifos" <address@hidden> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]