help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Copy and Pasting in Emacs...


From: Floyd L. Davidson
Subject: Re: Copy and Pasting in Emacs...
Date: Sun, 07 Mar 2004 19:36:46 -0900
User-agent: gnus 5.10.6/XEmacs 21.4.15/Linux 2.6.0

googleaddress@yahoo.co.uk (Patrick) wrote:
>i have just started to use emacs and unixy things..so apologies if
>this seems a little simple\naive
>
>I am currently using XEmacs on windows

One problem for the un-initiated is the ability to re-bind keys
to just about anything the user likes.  Hence it's hard to say
just what a specific set of key sequences will do once you have
anyone fooling with the configuration.

A second factor is that different terminals, and different kinds
of connections between the terminal and the host, cause hugely
varying results for certain key sequences.  For example, I doubt
that a CTRL+SPACEBAR works on many forms of remote connection to
a host, yet works fine when using the builtin system console.

You can go through your list of commands, one at a time, on your
Windows system, and determine the exact _functions_ being used
to accomplish your task.  Then on a remote system you can query
emacs about key bindings to learn which key sequences (if any)
can be used on that system.

  C-h k key-sequence

will tell you what the function name is.  Then, on the remote,

  M-x describe-bindings

will give you a list of all key bindings.  A quick search will
provide one (or more!) binding for any given function, or show
you that it can only be executed by name if there are no
bindings.

You then want to try the alternate bindings for things which
seem not to travel well over your network connection.

For example, here are the key sequences that I would use to do
what you describe:

>To copy a line in emacs i
>(a)put the cursor at the beginning of the line

  M-a        beginning-of-line

>(b)press CTRL+SPACEBAR

  M-space    set-mark-command

>(c)put the cursor at the end of the line

  M-e        end-of-line

>(d)press ALT+W (where ALT = metakey)

  M-w        kill-ring-save


There are other ways to do it too.

  M-x beginning-of-line
  M-x mark-end-of-line
  M-x kill-ring-save

The mark-end-of-line function is probably not bound to a key
sequence.

>now the line is copied...
>
>and to paste the copied line...
>
>(e)press CTRL-Y

Just for fun... copy several things into the kill ring  from
different places in a buffer, then use C-y to yank back the
last one.  They try M-y to replace it with the previous one,
continue using M-y to eventually get to the first region that
was copied.

>Now I have recently needed to use emacs on a remote machine (running
>under linux).
>I ssh into the machine from my computer (running windows) using ssh
>from cygwin.
>I open up emacs on this remote machine.
>But the steps (a) to (e) above will not work, i cannot copy a line.
>
>Anyone have any ideas where im going wrong? Im sure its pretty
>trivial, ive searched the net but to no avail.

Probably the C-space key sequence is not available via a remote
connection.

The trick you need is to find *all* such oddities, and then come
up with init files which make your two different systems act the
same way.  (As easy as that may sound... it isn't.)

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com


reply via email to

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