all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Copy Paste in no-x11 mode (emacs -nw)
@ 2008-09-25 15:06 Simeon Nifos
  2008-09-25 17:43 ` Thierry Volpiatto
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Simeon Nifos @ 2008-09-25 15:06 UTC (permalink / raw)
  To: help-gnu-emacs

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. Unfortunately there is no way to copy paste
something from one emacs window to a terminal or from a terminal to
the emacs window I am editing. 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.

Is there anyway I could activate this "underestimated" feature in the
mode I am using emacs? I apologize if this email sounds aggressive but
there are some things an editor is supposed to do by default and I
cannot understand why they are turned off in emacs.

We all know that emacs and vim documentation (as well the
documentation and manpages of many other Unix apps) is not providing
what is supposed to. Too much text explaining features in an language
only the ones who already know understand without giving any .emacs
examples to help us catch up. Having that in mind is there any full
featured samples .emacs file with comments explaining what is done
here or there which enables in emacs everything that should be enabled
by default, or which provides the features which are mandatory for
editing source code and latex documents?

Best,
S.N.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-25 15:06 Simeon Nifos
@ 2008-09-25 17:43 ` Thierry Volpiatto
  2008-09-25 18:40   ` Dan Davison
  2008-09-26  9:22 ` Jonathan Groll
  2008-09-26  9:40 ` Peter Dyballa
  2 siblings, 1 reply; 19+ messages in thread
From: Thierry Volpiatto @ 2008-09-25 17:43 UTC (permalink / raw)
  To: Simeon Nifos; +Cc: help-gnu-emacs

Hi,

"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. Unfortunately there is no way to copy paste
> something from one emacs window to a terminal or from a terminal to
> the emacs window I am editing. 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.

Try that:

,----
| (setq x-select-enable-clipboard t)
`----


> Is there anyway I could activate this "underestimated" feature in the
> mode I am using emacs? I apologize if this email sounds aggressive but
> there are some things an editor is supposed to do by default and I
> cannot understand why they are turned off in emacs.

Also you should use emacs in X to have a better experience with it (with font
also)

> We all know that emacs and vim documentation (as well the
> documentation and manpages of many other Unix apps) is not providing
> what is supposed to. Too much text explaining features in an language
> only the ones who already know understand without giving any .emacs
> examples to help us catch up. Having that in mind is there any full
> featured samples .emacs file with comments explaining what is done
> here or there which enables in emacs everything that should be enabled
> by default, or which provides the features which are mandatory for
> editing source code and latex documents?

You can find many .emacs on emacswiki.

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
       [not found] <mailman.19937.1222363379.18990.help-gnu-emacs@gnu.org>
@ 2008-09-25 17:43 ` Dan Espen
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Espen @ 2008-09-25 17:43 UTC (permalink / raw)
  To: help-gnu-emacs

"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. Unfortunately there is no way to copy paste
> something from one emacs window to a terminal or from a terminal to
> the emacs window I am editing. 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.

Copy/Paste is a function of the terminal, not Emacs, when you run
Emacs in a terminal.

> Is there anyway I could activate this "underestimated" feature in the
> mode I am using emacs? I apologize if this email sounds aggressive but
> there are some things an editor is supposed to do by default and I
> cannot understand why they are turned off in emacs.

I don't know why you are having problems doing copy/paste in a terminal.
You need to supply more information.  What OS are you using, what did you
do, what happened.  What did you expect to happen.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-25 17:43 ` Thierry Volpiatto
@ 2008-09-25 18:40   ` Dan Davison
  2008-09-26  8:40     ` Nikolaj Schumacher
  0 siblings, 1 reply; 19+ messages in thread
From: Dan Davison @ 2008-09-25 18:40 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, Sep 25, 2008 at 07:43:29PM +0200, Thierry Volpiatto wrote:
> Hi,
> 
> "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. Unfortunately there is no way to copy paste
> > something from one emacs window to a terminal or from a terminal to
> > the emacs window I am editing. 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.
> 
> Try that:
> 
> ,----
> | (setq x-select-enable-clipboard t)
> `----
> 
> 
> > Is there anyway I could activate this "underestimated" feature in the
> > mode I am using emacs? I apologize if this email sounds aggressive but
> > there are some things an editor is supposed to do by default and I
> > cannot understand why they are turned off in emacs.
> 
> Also you should use emacs in X to have a better experience with it (with font
> also)

That's a matter of taste, but I'm with Simeon -- I really like emacs
-nw in a terminal. Could you explain what advantages you perceive for
running it under X? One advantage I see for emacs -nw is that emacs
automatically has the same look/feel as other terminal sessions and
terminal-based applications such as mutt. In fact, mutt looks
extremely similar with its red mode-line equivalent, which is nice
since mutt spawns emacs to compose emails, which brings up a second
advantage -- the virtually instantaneous start up time of 

emacs -nw -Q -l essential-elisp-only-file.el

FWIW my attempt at a minimalist gnome/emacs aesthetic is as follows: I
never place any icons on my "desktop", keep all menus etc invisible,
and set the background to some suitable abstract artwork. Then emacs
-nw with

(tool-bar-mode -1)
(scroll-bar-mode -1)
(menu-bar-mode -1)
(setq inhibit-startup-message t)
(custom-set-faces
 '(mode-line ((t (:foreground "red" :inverse-video nil)))))
;; admittedly that's a pretty amateur way of making that setting...

run in gnome-terminal with a semi-transparent black background is
devoid of anything except the mode line text and the buffer contents,
and reveals darkened and non-distracting artwork behind emacs. The
font is selected via gnome-terminal, but I like the system
(ubuntu)-wide default.

DAn



> 
> > We all know that emacs and vim documentation (as well the
> > documentation and manpages of many other Unix apps) is not providing
> > what is supposed to. Too much text explaining features in an language
> > only the ones who already know understand without giving any .emacs
> > examples to help us catch up. Having that in mind is there any full
> > featured samples .emacs file with comments explaining what is done
> > here or there which enables in emacs everything that should be enabled
> > by default, or which provides the features which are mandatory for
> > editing source code and latex documents?
> 
> You can find many .emacs on emacswiki.
> 
> -- 
> A + Thierry Volpiatto
> Location: Saint-Cyr-Sur-Mer - France
> 

-- 
http://www.stats.ox.ac.uk/~davison




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-25 19:12 Simeon Nifos
@ 2008-09-26  8:17 ` Nikolaj Schumacher
  2008-09-26  9:02   ` Thierry Volpiatto
       [not found] ` <mailman.19983.1222417070.18990.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 19+ messages in thread
From: Nikolaj Schumacher @ 2008-09-26  8:17 UTC (permalink / raw)
  To: Simeon Nifos; +Cc: help-gnu-emacs

"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.



regards,
Nikolaj Schumacher




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
       [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
  1 sibling, 0 replies; 19+ messages in thread
From: Sébastien Vauban @ 2008-09-26  8:28 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Hi Simeon,

> I do have enabled the following in my .emacs:
> ====================
> (xterm-mouse-mode t)
> (mouse-wheel-mode t)
> (setq x-select-enable-clipboard t)
> =====================
>
> Anything else to try? Can you copy paste in terminal? And it makes no
> difference if I use XTerm or Eterm. In both the Kill ring is empty.

Try:

--8<---------------cut here---------------start------------->8---
    ;; make cut, copy and paste (keys and menu bar items) use the clipboard
    (menu-bar-enable-clipboard)
--8<---------------cut here---------------end--------------->8---

Best regards,
  Seb

--
Sébastien Vauban


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-25 18:40   ` Dan Davison
@ 2008-09-26  8:40     ` Nikolaj Schumacher
  0 siblings, 0 replies; 19+ messages in thread
From: Nikolaj Schumacher @ 2008-09-26  8:40 UTC (permalink / raw)
  To: help-gnu-emacs

Dan Davison <davison@stats.ox.ac.uk> wrote:

> That's a matter of taste, but I'm with Simeon -- I really like emacs
> -nw in a terminal. Could you explain what advantages you perceive for
> running it under X?

a few:

* All keys work, regardless of terminal settings.
* I can steal system keybindings (like cmd-h)
* System integration (copy&paste)
* Ability to spawn new frames (mostly for `gnus-other-frame')
* Appearance modifiable by elisp
* More and nicer colors
* Tetris looks way better :)
* Usable fringes (i.e. Edebug doesn't draw over text)
* Scrollbar (I don't use it, but it's nice visual location info)

Speed is the most important thing -nw has, of course.  The looks on the
other hand are very customizable.  Hiding the toolbar and menubar were
the first things I did.


regards,
Nikolaj Schumacher




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
       [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
  0 siblings, 1 reply; 19+ messages in thread
From: Joost Kremers @ 2008-09-26  8:57 UTC (permalink / raw)
  To: help-gnu-emacs

Nikolaj Schumacher wrote:
> 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.

or you can use X's general copy/paste function using the mouse: select text
with button1, paste it with button2 (i.e. the middle button on a
three-button mouse. which on a two-button mouse is often emulated by
clicking both buttons simultaneously.)


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-26  8:17 ` Copy " Nikolaj Schumacher
@ 2008-09-26  9:02   ` Thierry Volpiatto
  2008-09-26 12:04     ` Jonathan Groll
  0 siblings, 1 reply; 19+ messages in thread
From: Thierry Volpiatto @ 2008-09-26  9:02 UTC (permalink / raw)
  To: Nikolaj Schumacher; +Cc: Simeon Nifos, help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-25 15:06 Simeon Nifos
  2008-09-25 17:43 ` Thierry Volpiatto
@ 2008-09-26  9:22 ` Jonathan Groll
  2008-09-26  9:40 ` Peter Dyballa
  2 siblings, 0 replies; 19+ messages in thread
From: Jonathan Groll @ 2008-09-26  9:22 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Simeon Nifos

On Thu, Sep 25, 2008 at 06:06:40PM +0300, Simeon Nifos wrote:
>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. Unfortunately there is no way to copy paste
>something from one emacs window to a terminal or from a terminal to
>the emacs window I am editing. 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.

At least under KDE, Shift-Insert pastes the content of the clipboard;
to copy though I have to use the mouse to highlight (which
automatically inserts it onto the Unix-style clipboard for me). 

Put in those terms, the problem is then how to get M-w to also place
the item into the system clipboard (for -nw), I would much rather do
that than to have to reach for the mouse.

Cheers,
Jonathan.

P.S. Of course, one *could* run a gnu-screen session which has got
it's own copy-paste features that are completely keyboard
controllable, but that is not what you were asking for.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-25 15:06 Simeon Nifos
  2008-09-25 17:43 ` Thierry Volpiatto
  2008-09-26  9:22 ` Jonathan Groll
@ 2008-09-26  9:40 ` Peter Dyballa
  2 siblings, 0 replies; 19+ messages in thread
From: Peter Dyballa @ 2008-09-26  9:40 UTC (permalink / raw)
  To: Simeon Nifos; +Cc: help-gnu-emacs


Am 25.09.2008 um 17:06 schrieb Simeon Nifos:

> Unfortunately there is no way to copy paste
> something from one emacs window to a terminal or from a terminal to
> the emacs window I am editing.


This is not true. GNU Emacs, when running as a command line programme  
without own windows, then has no access to the windowing system. As  
almost all other command line programmes (some have, they can insert  
for example the contents of the clipboard or put a text into an X  
selection). In case GNU Emacs' host, in your case the Eterm utility,  
has access to the windowing system, you can use the host's  
capabilities. This works in a few terminal emulations under X11 or  
Apple's Aqua.

--
Greetings

   Pete

I love deadlines. I love the whooshing noise they make as they go by.
				– Douglas Adams







^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-26  8:57   ` Joost Kremers
@ 2008-09-26 10:35     ` Thierry Volpiatto
  0 siblings, 0 replies; 19+ messages in thread
From: Thierry Volpiatto @ 2008-09-26 10:35 UTC (permalink / raw)
  To: help-gnu-emacs

Second part, using screen to communicate (kill/yank)
between terminal/emacs.

With this code you can copy text in emacs and retrieve it in screen.

,----
| (defun tv-copy-for-screen (beg end)
|   (interactive "r")
|   (let ((k-region (buffer-substring-no-properties beg end))
|         (require-final-newline nil))
|     (save-excursion
|       (find-file "~/.screen_exchange")
|       (goto-char (point-min))
|       (erase-buffer)
|       (insert (replace-regexp-in-string "\n" "" k-region))
|       (save-buffer)
|       (kill-buffer (current-buffer)))))
| 
| (global-set-key (kbd "C-c C") 'tv-copy-for-screen)
`----

When you are in screen, first read paste-buffer with
"<screen-prefix-key> <"
and then paste with "<screen-prefix-key> ]"

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-26  9:02   ` Thierry Volpiatto
@ 2008-09-26 12:04     ` Jonathan Groll
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Groll @ 2008-09-26 12:04 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: help-gnu-emacs

On Fri, Sep 26, 2008 at 11:02:09AM +0200, Thierry Volpiatto wrote:
>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 :)
>

Also I must add since we all use Emacs C-a is an unacceptable screen
prefix key (it is the default). I much prefer the backtick, set using
the following in ~/.screenrc

escape ``

I will definitely add your screen functions to my personal elisp
library. Thanks!

Cheers,
Jonathan




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
@ 2008-09-26 12:26 Simeon Nifos
  2008-09-26 15:00 ` Jonathan Groll
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Simeon Nifos @ 2008-09-26 12:26 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, Sep 26, 2008 at 12:40 PM,  <help-gnu-emacs-request@gnu.org> wrote:
> Send help-gnu-emacs mailing list submissions to
>        help-gnu-emacs@gnu.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
> or, via email, send a message with subject or body 'help' to
>        help-gnu-emacs-request@gnu.org
>
> You can reach the person managing the list at
>        help-gnu-emacs-owner@gnu.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of help-gnu-emacs digest..."
>
>
Hello,
I will answer to all of you within this single post:

> What are you using to paste in vim.  "p"?  To my knowledge that
> shouldn't work, either.  (And doesn't, on my machine.)

I highlight text with the mouse and then press the middle mouse button
in vim where I want to paste it and it does it without destroying the
format. I had to do some searching for corresponding configuration
of the VIM .vimrc, and also use VIM compiled with clipboard enabled.
If you type
$ vim --version
VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct  5 2007 01:40:01)
Included patches: 1-56
Compiled by buildd@crested.buildd
Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist
 +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
+netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile
+python +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white +tcl +terminfo +termresponse +textobjects +title +toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact
+xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
-DPNG_NO_MMX_CODE -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
-I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/freetype2 -I/usr/include/libpng12   -DORBIT2=1 -pthread
-DPNG_NO_MMX_CODE -I/usr/include/libgnomeui-2.0
-I/usr/include/libart-2.0 -I/usr/include/gconf/2
-I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0
-I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0
-I/usr/include/gtk-2.0 -I/usr/include/gnome-vfs-2.0
-I/usr/lib/gnome-vfs-2.0/include -I/usr/include/orbit-2.0
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0
-I/usr/include/libxml2 -I/usr/include/pango-1.0
-I/usr/include/freetype2 -I/usr/include/gail-1.0
-I/usr/include/atk-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo
-I/usr/include/libpng12     -O2 -g -Wall    -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN  -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64  -I/usr/lib/perl/5.8/CORE
-I/usr/include/python2.5 -pthread -I/usr/include/tcl8.4
-D_REENTRANT=1  -D_THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1
-I/usr/lib/ruby/1.8/x86_64-linux
Linking: gcc   -L.  -rdynamic -Wl,-export-dynamic  -Wl,-E
-L/usr/local/lib -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lpangocairo-1.0 -lfontconfig -lXext -lXrender
-lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lpango-1.0
-lcairo -lXfixes -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
-lgnomeui-2 -lbonoboui-2 -lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt
-lbonobo-2 -lbonobo-activation -lart_lgpl_2 -lgtk-x11-2.0
-lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lfontconfig
-lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite
-lXdamage -lpango-1.0 -lcairo -lXfixes -lgconf-2 -lgmodule-2.0
-lORBit-2 -lgthread-2.0 -lrt -lgobject-2.0 -lglib-2.0   -lXt -lncurses
-lgpm   -Wl,-E  -L/usr/local/lib
/usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a
-L/usr/lib/perl/5.8/CORE -lperl -L/usr/lib/python2.5/config
-lpython2.5 -lutil -Xlinker -export-dynamic -L/usr/lib -ltcl8.4 -lieee
-lruby1.8 -lm

this is what I get. Notice +clipboard and similar +clipboard_xterm and
other +mouse_xterm e.t.c. Most vim packages have disabled those
configurations. I am installing vim running in an Ubuntu/Debian based
system:
# apt-get install vim-full

If you have something similar then highlighting text somewhere and
pressing the middle mouse button will get you the copy paste effect
you ask for.

> * All keys work, regardless of terminal settings.
> * I can steal system keybindings (like cmd-h)
> * System integration (copy&paste)
> * Ability to spawn new frames (mostly for `gnus-other-frame')
> * Appearance modifiable by elisp
> * More and nicer colors
> * Tetris looks way better :)
> * Usable fringes (i.e. Edebug doesn't draw over text)
> * Scrollbar (I don't use it, but it's nice visual location info)
>

Nice GDB DEBUGGING interface.

> Speed is the most important thing -nw has, of course.  The looks on the
> other hand are very customizable.  Hiding the toolbar and menubar were
> the first things I did.

Can you tell us how?

Moreover, could you please tell us how to move the border up or down,
left or right separating the 2 windows the original window is splitted
to when one presses C-x 2, or C-x 3?


Guys this is amazing:
=================
Enabling syntax highlighting in vim, if you browse a huge C,C++ file,
you will see that vim slows down significantly even when running on
latest Intel Core 2 Duo processor. On the contrary emacs -nw with
syntax highlighting on is as fast as VIM without syntax highlighting
as if highlighting has no overhead at all.
=================



> 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 :)

Thank you for the long reply, but neither of those C-p or C-a works for me.

Jonathan thanks very very much. Shift-Insert works for me as well
I am running E17. I hate KDE since it is too buggy and very heavy as
a desktop. Not to mention that it crashes frequently and the latest 4.1
is a wrong decision from the very beginning.

> Put in those terms, the problem is then how to get M-w to also place
> the item into the system clipboard (for -nw), I would much rather do
> that than to have to reach for the mouse.

I agree, any ideas?

I would like to do the Shift-Insert thing with the mouse. The usual way,
highlight text and press middle mouse button for the paste. Any ideas?

Thank you all but lets try to get this a bit further since it is a
really useful
feature that is missing and it makes our life harder.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-26 12:26 Copy Paste in no-x11 mode (emacs -nw) Simeon Nifos
@ 2008-09-26 15:00 ` Jonathan Groll
       [not found] ` <mailman.20006.1222441218.18990.help-gnu-emacs@gnu.org>
  2008-09-26 16:58 ` Nikolaj Schumacher
  2 siblings, 0 replies; 19+ messages in thread
From: Jonathan Groll @ 2008-09-26 15:00 UTC (permalink / raw)
  To: Simeon Nifos; +Cc: help-gnu-emacs

On Fri, Sep 26, 2008 at 03:26:19PM +0300, Simeon Nifos wrote:
(snip)
>I highlight text with the mouse and then press the middle mouse button
>in vim where I want to paste it and it does it without destroying the
>format. I had to do some searching for corresponding configuration
>of the VIM .vimrc, and also use VIM compiled with clipboard enabled.

Not sure what you mean by destroying format, but I can paste into
emacs -nw with no problems by using a middle-click (kubuntu 8.04,
still KDE 3.5, also in emacs -nw under an OS X terminal.app shell).

(snip)
>Moreover, could you please tell us how to move the border up or down,
>left or right separating the 2 windows the original window is splitted
>to when one presses C-x 2, or C-x 3?

In regular emacs, assuming you have done C-x 2, and the scrollbar is
on the left hand side; hover the mouse over the scrollbar area at the
junction between the two windows and you will see the icon change to
the resize icon.

(snip)
>Thank you for the long reply, but neither of those C-p or C-a works for me.

It needs to be configured for C-p, otherwise C-a will be the default
gnu-screen escape sequence. For instance, if you are in a screen
session, pressing C-a c will create a new screen window. I recommend
you set it to another escape sequence as emacs users tend to need C-a.

(snip)
>I would like to do the Shift-Insert thing with the mouse. The usual way,
>highlight text and press middle mouse button for the paste. Any ideas?

Not sure what the problem is for you here - middle click should work,
even in emacs -nw running in your xterms/eterms. Can you try it in
an alternative window manager perhaps?

Another thing that I do find useful is a clipboard manager if you do
end up doing a lot of middle-click pastes; parcellite should run under
enlightenment. But heck, that may be a little too newfangled for most
of us emacs folk.

Cheers,
Jonathan




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
       [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
  0 siblings, 1 reply; 19+ messages in thread
From: Charles Sebold @ 2008-09-26 15:18 UTC (permalink / raw)
  To: help-gnu-emacs

On 26 Sep 2008, Jonathan Groll wrote:

> On Fri, Sep 26, 2008 at 03:26:19PM +0300, Simeon Nifos wrote:
> (snip)
>> I highlight text with the mouse and then press the middle mouse
>> button in vim where I want to paste it and it does it without
>> destroying the format. I had to do some searching for corresponding
>> configuration of the VIM .vimrc, and also use VIM compiled with
>> clipboard enabled.
>
> Not sure what you mean by destroying format, but I can paste into
> emacs -nw with no problems by using a middle-click (kubuntu 8.04,
> still KDE 3.5, also in emacs -nw under an OS X terminal.app shell).

Maybe the key is in the "where I want to paste it" part?  When I do
this, it inserts at cursor, not necessarily where I mouse-2'd.
-- 
Charles Sebold                                   26th of September, 2008


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
       [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
  1 sibling, 0 replies; 19+ messages in thread
From: Dan Espen @ 2008-09-26 15:29 UTC (permalink / raw)
  To: help-gnu-emacs

"Simeon Nifos" <archwndas@googlemail.com> writes:

>> Message: 9
>> Date: Thu, 25 Sep 2008 13:43:51 -0400
>> From: Dan Espen <daneNO@MORE.mk.SPAMtelcordia.com>
>> Subject: Re: Copy Paste in no-x11 mode (emacs -nw)
>> To: help-gnu-emacs@gnu.org
>> Message-ID: <icskrorui0.fsf@verizon.net>
>> Content-Type: text/plain; charset=us-ascii
>>
>> "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. Unfortunately there is no way to copy paste
>>> something from one emacs window to a terminal or from a terminal to
>>> the emacs window I am editing. 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 love Unix myself. But ...
> it could have been made much better and much popular if it allowed
> what a person expects to have out of the box ... And I am not talking
> about fancy (or should I call them stupid) KDE stuff.

What are you going on about?
I said "No" to get your attention.
This is not an Emacs issue.
As other have told you, Emacs has no idea about the X clipboard
when you run "-nw".

>> 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? There are more
> things in EMACS than there are in VIM, like debug, like autoformating
> of text and C++ comments, and LaTeX documents which are enabled
> by default in EMACS and not in VIM. If only the copy paste worked.
> I would not need to abandon EMACS at all. Now I do.
>
>>> Is there anyway I could activate this "underestimated" feature in the
>>> mode I am using emacs? I apologize if this email sounds aggressive but
>>> there are some things an editor is supposed to do by default and I
>>> cannot understand why they are turned off in emacs.
>>
>> I don't know why you are having problems doing copy/paste in a terminal.
>> You need to supply more information.  What OS are you using, what did you
>> do, what happened.  What did you expect to happen.
>
> 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"
>
> I do have enabled the following in my .emacs:
> ====================
> (xterm-mouse-mode t)
> (mouse-wheel-mode t)
> (setq x-select-enable-clipboard t)
> =====================
>
> Anything else to try? Can you copy paste in terminal? And it makes no
> difference if I use XTerm or Eterm. In both the Kill ring is empty.

You still didn't tell us what you did that didn't work.
I have to guess you stroked text with the mouse then tried to paste.

If you used menubar copy, try to use menubar paste in the
terminal.

Remember, your issue is with the terminal, not emacs.
Try copy paste in the terminal without Emacs running.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-26 12:26 Copy Paste in no-x11 mode (emacs -nw) Simeon Nifos
  2008-09-26 15:00 ` Jonathan Groll
       [not found] ` <mailman.20006.1222441218.18990.help-gnu-emacs@gnu.org>
@ 2008-09-26 16:58 ` Nikolaj Schumacher
  2 siblings, 0 replies; 19+ messages in thread
From: Nikolaj Schumacher @ 2008-09-26 16:58 UTC (permalink / raw)
  To: Simeon Nifos; +Cc: help-gnu-emacs

"Simeon Nifos" <archwndas@googlemail.com> wrote:

>> Hiding the toolbar and menubar were the first things I did.
>
> Can you tell us how?

in my .emacs:

(unless (eq system-type 'darwin)
  (menu-bar-mode 0))
(tool-bar-mode 0)

> Moreover, could you please tell us how to move the border up or down,
> left or right separating the 2 windows the original window is splitted
> to when one presses C-x 2, or C-x 3?

shrink-window, shrink-window-horizontally, enlarge-window and
enlarge-window-horizontally

But since I can never remember their keys, I actually use the following:

(defvar window-resize-mode-map
  (let ((keymap (make-sparse-keymap)))
    (define-key keymap "\C-p" 'shrink-window)
    (define-key keymap "\C-b" 'shrink-window-horizontally)
    (define-key keymap "\C-n" 'enlarge-window)
    (define-key keymap "\C-f" 'enlarge-window-horizontally)
    (define-key keymap "\C-c\C-c" 'window-resize-mode)
    (define-key keymap "q" 'window-resize-mode)
    keymap))

(define-minor-mode window-resize-mode
  "Interactively resize the window using text-movement commands."
  nil "resize " window-resize-mode-map
  :global t)

After C-x2, you can also drag the mode line with the mouse.



regards,
Nikolaj Schumacher




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Copy Paste in no-x11 mode (emacs -nw)
  2008-09-26 15:18   ` Charles Sebold
@ 2008-09-27  1:52     ` Kevin Rodgers
  0 siblings, 0 replies; 19+ messages in thread
From: Kevin Rodgers @ 2008-09-27  1:52 UTC (permalink / raw)
  To: help-gnu-emacs

Charles Sebold wrote:
> On 26 Sep 2008, Jonathan Groll wrote:
> 
>> On Fri, Sep 26, 2008 at 03:26:19PM +0300, Simeon Nifos wrote:
>> (snip)
>>> I highlight text with the mouse and then press the middle mouse
>>> button in vim where I want to paste it and it does it without
>>> destroying the format. I had to do some searching for corresponding
>>> configuration of the VIM .vimrc, and also use VIM compiled with
>>> clipboard enabled.
>> Not sure what you mean by destroying format, but I can paste into
>> emacs -nw with no problems by using a middle-click (kubuntu 8.04,
>> still KDE 3.5, also in emacs -nw under an OS X terminal.app shell).
> 
> Maybe the key is in the "where I want to paste it" part?  When I do
> this, it inserts at cursor, not necessarily where I mouse-2'd.

That's because the terminal doesn't know where the mouse is.  I don't
understand how it possibly could, but the xt-mouse library apparently
does exactly that -- try it out, it's included with Emacs.

Also, `C-h v mouse-yank-at-point'.

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2008-09-27  1:52 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-26 12:26 Copy Paste in no-x11 mode (emacs -nw) 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.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-25 19:12 Simeon Nifos
2008-09-26  8:17 ` Copy " Nikolaj Schumacher
2008-09-26  9:02   ` Thierry Volpiatto
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.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

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.