all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: Nikolaj Schumacher <me@nschum.de>
Cc: Simeon Nifos <archwndas@googlemail.com>, help-gnu-emacs@gnu.org
Subject: Re: Copy Paste in no-x11 mode (emacs -nw)
Date: Fri, 26 Sep 2008 11:02:09 +0200	[thread overview]
Message-ID: <87od2bp9f2.fsf@tux.homenetwork> (raw)
In-Reply-To: <m2vdwj1ftj.fsf@nschum.de> (Nikolaj Schumacher's message of "Fri,  26 Sep 2008 10:17:44 +0200")

Nikolaj Schumacher <me@nschum.de> writes:

> "Simeon Nifos" <archwndas@googlemail.com> wrote:
>
>>> "Simeon Nifos" <archwndas@googlemail.com> 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	other threads:[~2008-09-26  9:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-25 19:12 Re:Copy Paste in no-x11 mode (emacs -nw) Simeon Nifos
2008-09-26  8:17 ` Copy " Nikolaj Schumacher
2008-09-26  9:02   ` Thierry Volpiatto [this message]
2008-09-26 12:04     ` Jonathan Groll
     [not found] ` <mailman.19983.1222417070.18990.help-gnu-emacs@gnu.org>
2008-09-26  8:57   ` Joost Kremers
2008-09-26 10:35     ` Thierry Volpiatto
     [not found] <mailman.19960.1222401724.18990.help-gnu-emacs@gnu.org>
2008-09-26  8:28 ` Sébastien Vauban
2008-09-26 15:29 ` Dan Espen
  -- strict thread matches above, loose matches on Subject: below --
2008-09-26 12:26 Simeon Nifos
2008-09-26 15:00 ` Jonathan Groll
     [not found] ` <mailman.20006.1222441218.18990.help-gnu-emacs@gnu.org>
2008-09-26 15:18   ` Charles Sebold
2008-09-27  1:52     ` Kevin Rodgers
2008-09-26 16:58 ` Nikolaj Schumacher
     [not found] <mailman.19937.1222363379.18990.help-gnu-emacs@gnu.org>
2008-09-25 17:43 ` Dan Espen
2008-09-25 15:06 Simeon Nifos
2008-09-25 17:43 ` Thierry Volpiatto
2008-09-25 18:40   ` Dan Davison
2008-09-26  8:40     ` Nikolaj Schumacher
2008-09-26  9:22 ` Jonathan Groll
2008-09-26  9:40 ` Peter Dyballa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87od2bp9f2.fsf@tux.homenetwork \
    --to=thierry.volpiatto@gmail.com \
    --cc=archwndas@googlemail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=me@nschum.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.