all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* copying and pasting in emacs
@ 2009-04-05 14:17 luca.pamparana
  2009-04-05 14:56 ` Richard Riley
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: luca.pamparana @ 2009-04-05 14:17 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I am unable to figure out how to select and copy text as you would do
in another editors:

For example, one thing I normally need to do is select from the
current position upto the next few words. Normally, I just press shift
+ ctrl and the left or right arrow key and the editor would highlight
one word at a time. I have so far been unable to figure out how to
highlight text in emacs using the keyboard.

Anyone knows how I can do it esp. highlighting one word, line etc. at
a time.

Many thanks,

Luca


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

* Re: copying and pasting in emacs
  2009-04-05 14:17 luca.pamparana
@ 2009-04-05 14:56 ` Richard Riley
  2009-04-05 14:57 ` lore
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 18+ messages in thread
From: Richard Riley @ 2009-04-05 14:56 UTC (permalink / raw)
  To: help-gnu-emacs


luca.pamparana@gmail.com writes:

> Hello,
>
> I am unable to figure out how to select and copy text as you would do
> in another editors:
>
> For example, one thing I normally need to do is select from the
> current position upto the next few words. Normally, I just press shift
> + ctrl and the left or right arrow key and the editor would highlight
> one word at a time. I have so far been unable to figure out how to
> highlight text in emacs using the keyboard.
>
> Anyone knows how I can do it esp. highlighting one word, line etc. at
> a time.
>
> Many thanks,
>
> Luca

Google up "emacs mark region"

e.g

http://as760.http.sasm3.net/textbooks/emacs/emacs_12.html


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

* Re: copying and pasting in emacs
  2009-04-05 14:17 luca.pamparana
  2009-04-05 14:56 ` Richard Riley
@ 2009-04-05 14:57 ` lore
  2009-04-05 15:45 ` Nurullah Akkaya
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 18+ messages in thread
From: lore @ 2009-04-05 14:57 UTC (permalink / raw)
  To: help-gnu-emacs

luca pamparana wrote:

> For example, one thing I normally need to do is select from the
> current position upto the next few words. Normally, I just press shift
> + ctrl and the left or right arrow key and the editor would highlight
> one word at a time. I have so far been unable to figure out how to
> highlight text in emacs using the keyboard.

,----
| C-@ runs the command set-mark-command, which is an interactive
| compiled Lisp function.
| 
| It is bound to C-SPC, C-@.
`----

Then you can move (M-b, M-f, C-p, C-n or so...)

Do not forget transient-mark-mode.

-- 
Systems.Administrators.like.things.automated.


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

* Re: copying and pasting in emacs
  2009-04-05 14:17 luca.pamparana
  2009-04-05 14:56 ` Richard Riley
  2009-04-05 14:57 ` lore
@ 2009-04-05 15:45 ` Nurullah Akkaya
  2009-04-05 16:06 ` rustom
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 18+ messages in thread
From: Nurullah Akkaya @ 2009-04-05 15:45 UTC (permalink / raw)
  To: luca.pamparana; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

On Sun, Apr 5, 2009 at 5:17 PM, <luca.pamparana@gmail.com> wrote:

> Hello,
>
> I am unable to figure out how to select and copy text as you would do
> in another editors:
>
> For example, one thing I normally need to do is select from the
> current position upto the next few words. Normally, I just press shift
> + ctrl and the left or right arrow key and the editor would highlight
> one word at a time. I have so far been unable to figure out how to
> highlight text in emacs using the keyboard.
>
> Anyone knows how I can do it esp. highlighting one word, line etc. at
> a time.
>
> Many thanks,
>
> Luca
>


Enable delete-selection in your .emacs by adding

(delete-selection-mode)

after that when you press Ctrl+space you start selecting regions.
Normal movement keys apply.

Ctrl+space
Ctrl+e

will select from cursor to the end of line.

Nurullah Akkaya

[-- Attachment #2: Type: text/html, Size: 1229 bytes --]

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

* Re: copying and pasting in emacs
  2009-04-05 14:17 luca.pamparana
                   ` (2 preceding siblings ...)
  2009-04-05 15:45 ` Nurullah Akkaya
@ 2009-04-05 16:06 ` rustom
  2009-04-05 17:48   ` Drew Adams
  2009-04-05 17:53 ` Peter Finn
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: rustom @ 2009-04-05 16:06 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 5, 7:17 pm, luca.pampar...@gmail.com wrote:
> Hello,
>
> I am unable to figure out how to select and copy text as you would do
> in another editors:
>
> For example, one thing I normally need to do is select from the
> current position upto the next few words. Normally, I just press shift
> + ctrl and the left or right arrow key and the editor would highlight
> one word at a time. I have so far been unable to figure out how to
> highlight text in emacs using the keyboard.
>
> Anyone knows how I can do it esp. highlighting one word, line etc. at
> a time.
>
> Many thanks,
>
> Luca

See cua-mode and related stuff (http://www.emacswiki.org/emacs/
CuaMode )


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

* RE: copying and pasting in emacs
  2009-04-05 16:06 ` rustom
@ 2009-04-05 17:48   ` Drew Adams
  0 siblings, 0 replies; 18+ messages in thread
From: Drew Adams @ 2009-04-05 17:48 UTC (permalink / raw)
  To: help-gnu-emacs

> > I am unable to figure out how to select and copy text as 
> > you would do in another editors:
> >
> > For example, one thing I normally need to do is select from the
> > current position upto the next few words. Normally, I just 
> > press shift + ctrl and the left or right arrow key and the
> > editor would highlight one word at a time. I have so far been
> > unable to figure out how to highlight text in emacs using the
> > keyboard.
> >
> > Anyone knows how I can do it esp. highlighting one word, 
> > line etc. at a time.
> 
> See cua-mode and related stuff 
> (http://www.emacswiki.org/emacs/CuaMode)


CUA mode is not for everyone, and is not necessarily the best place to start
looking into this question, IMO.

This is the overall category - active "region" means (~) "selection":
http://www.emacswiki.org/emacs-en?CategoryRegion

(I just added CuaMode to that page, BTW; it was missing.)

These are some entries at that page which are good starting points:

* http://www.emacswiki.org/emacs-en/Region - meaning and behavior of the region

* http://www.emacswiki.org/emacs-en/DefaultKillingAndYanking - vanilla Emacs
behavior and terminology for copy/paste

* http://www.emacswiki.org/emacs-en/CopyAndPaste - alternatives (including CUA
mode) to the vanilla Emacs copy/paste behavior

See also the Emacs manual, node Transient Mark:
http://www.gnu.org/software/emacs/manual/html_node/emacs/Transient-Mark.html#Tra
nsient-Mark

My own recommendation (not CUA mode), FWIW:

* http://www.emacswiki.org/emacs-en/DeleteSelectionMode






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

* Re: copying and pasting in emacs
  2009-04-05 14:17 luca.pamparana
                   ` (3 preceding siblings ...)
  2009-04-05 16:06 ` rustom
@ 2009-04-05 17:53 ` Peter Finn
       [not found] ` <mailman.4665.1238954048.31690.help-gnu-emacs@gnu.org>
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 18+ messages in thread
From: Peter Finn @ 2009-04-05 17:53 UTC (permalink / raw)
  To: help-gnu-emacs

At Sun, 5 Apr 2009 07:17:02 -0700 (PDT),
luca pamparana wrote:
> 
> Hello,
> 
> I am unable to figure out how to select and copy text as you would do
> in another editors:
> 
> For example, one thing I normally need to do is select from the
> current position upto the next few words. Normally, I just press shift
> + ctrl and the left or right arrow key and the editor would highlight
> one word at a time. I have so far been unable to figure out how to
> highlight text in emacs using the keyboard.
> 
> Anyone knows how I can do it esp. highlighting one word, line etc. at
> a time.
> 
> Many thanks,
> 
> Luca

If you want behavior similar to other editors you might want to try
turning on CUA mode (M-x cua-mode <RET>) which will give you exactly the
selection behavior you want (using <SHIFT> in combination with <ARROW>);
as well as key-bindings for the copying, cutting, and pasting of text
similar to other editors you may be familiar with.

CUA mode can be enabled permanently through Emacs' customization
facility by typing: M-x customize-variable <RET> cua-mode <RET> and
setting is value to ON, and saving your changes.

Peter




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

* Re: copying and pasting in emacs
       [not found] ` <mailman.4665.1238954048.31690.help-gnu-emacs@gnu.org>
@ 2009-04-05 21:43   ` B. T. Raven
  0 siblings, 0 replies; 18+ messages in thread
From: B. T. Raven @ 2009-04-05 21:43 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Finn wrote:
> At Sun, 5 Apr 2009 07:17:02 -0700 (PDT),
> luca pamparana wrote:
>> Hello,
>>
>> I am unable to figure out how to select and copy text as you would do
>> in another editors:
>>
>> For example, one thing I normally need to do is select from the
>> current position upto the next few words. Normally, I just press shift
>> + ctrl and the left or right arrow key and the editor would highlight
>> one word at a time. I have so far been unable to figure out how to
>> highlight text in emacs using the keyboard.
>>
>> Anyone knows how I can do it esp. highlighting one word, line etc. at
>> a time.
>>
>> Many thanks,
>>
>> Luca
> 
> If you want behavior similar to other editors you might want to try
> turning on CUA mode (M-x cua-mode <RET>) which will give you exactly the
> selection behavior you want (using <SHIFT> in combination with <ARROW>);
> as well as key-bindings for the copying, cutting, and pasting of text
> similar to other editors you may be familiar with.
> 
> CUA mode can be enabled permanently through Emacs' customization
> facility by typing: M-x customize-variable <RET> cua-mode <RET> and
> setting is value to ON, and saving your changes.
> 
> Peter
> 
> 

And if you want the basic pc selection keys but want to leave Emacs 
undisturbed for everything else then do this:

Menu>Customize Emacs>Specific Group....
pc-select
Then turn on 1, 2, and 5 (Override Scroll Error, Pc Selection Keys Only, 
and Pc Selection Mode)
Save for future sessions


This will save the settings in your .emacs. This way the setup will 
encourage or at least allow you to learn C-space, C-w, M-w, C-y, M-y, 
and Emacs standard cursor movement keys.

Ed


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

* Re: copying and pasting in emacs
  2009-04-05 14:17 luca.pamparana
                   ` (5 preceding siblings ...)
       [not found] ` <mailman.4665.1238954048.31690.help-gnu-emacs@gnu.org>
@ 2009-04-06  7:29 ` Nikolaj Schumacher
       [not found] ` <mailman.4658.1238946331.31690.help-gnu-emacs@gnu.org>
  7 siblings, 0 replies; 18+ messages in thread
From: Nikolaj Schumacher @ 2009-04-06  7:29 UTC (permalink / raw)
  To: luca.pamparana; +Cc: help-gnu-emacs

luca.pamparana@gmail.com wrote:

> Anyone knows how I can do it esp. highlighting one word, line etc. at
> a time.

Try `mark-word' (M-@ by default).


regards,
Nikolaj Schumacher




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

* RE: copying and pasting in emacs
@ 2009-04-06  9:07 Bourgneuf Francois
  2009-04-06  9:42 ` Daniel Dalton
       [not found] ` <mailman.4706.1239028278.31690.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 18+ messages in thread
From: Bourgneuf Francois @ 2009-04-06  9:07 UTC (permalink / raw)
  To: luca.pamparana, help-gnu-emacs

C-<space> to mark the beginnig of the region you want to copy,
then move to the end of the region
M-w to copy

Use C-y for pasting (y stands for yank)
bour9

> -----Message d'origine-----
> De : 
> help-gnu-emacs-bounces+francois.bourgneuf=groupe-mma.fr@gnu.or
> g 
> [mailto:help-gnu-emacs-bounces+francois.bourgneuf=groupe-mma.f
> r@gnu.org] De la part de luca.pamparana@gmail.com
> Envoyé : dimanche 5 avril 2009 16:17
> À : help-gnu-emacs@gnu.org
> Objet : copying and pasting in emacs
> 
> Hello,
> 
> I am unable to figure out how to select and copy text as you would do
> in another editors:
> 
> For example, one thing I normally need to do is select from the
> current position upto the next few words. Normally, I just press shift
> + ctrl and the left or right arrow key and the editor would highlight
> one word at a time. I have so far been unable to figure out how to
> highlight text in emacs using the keyboard.
> 
> Anyone knows how I can do it esp. highlighting one word, line etc. at
> a time.
> 
> Many thanks,
> 
> Luca
> 
> 




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

* Re: copying and pasting in emacs
  2009-04-06  9:07 copying and pasting in emacs Bourgneuf Francois
@ 2009-04-06  9:42 ` Daniel Dalton
  2009-04-06 14:55   ` Peter Dyballa
  2009-04-06 14:56   ` Renaud Casenave-Péré
       [not found] ` <mailman.4706.1239028278.31690.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 18+ messages in thread
From: Daniel Dalton @ 2009-04-06  9:42 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 441 bytes --]

On Mon, Apr 06, 2009 at 11:07:41AM +0200, Bourgneuf Francois wrote:
> Use C-y for pasting (y stands for yank)

I know I'm going to probably get yelled at, sorry I know I should go
read the manual, but considering this was asked, what's the command to
grab an old yank?
eg. yank something that was cut before the last cut?
eg. ctr+space ctr+w ctr+k then oh damn, how do I paste that first block
of text?

Hope that makes sense!

Thx

Daniel.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: copying and pasting in emacs
@ 2009-04-06  9:47 Daniel Dalton
  2009-04-06 14:55 ` Alan Mackenzie
  0 siblings, 1 reply; 18+ messages in thread
From: Daniel Dalton @ 2009-04-06  9:47 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, Apr 06, 2009 at 11:07:41AM +0200, Bourgneuf Francois wrote:
> Use C-y for pasting (y stands for yank)

I know I'm going to probably get yelled at, sorry I know I should go
read the manual, but considering this was asked, what's the command to
grab an old yank?
eg. yank something that was cut before the last cut?
eg. ctr+space ctr+w ctr+k then oh damn, how do I paste that first block
of text?

Hope that makes sense!

Thx

Daniel.







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

* Re: copying and pasting in emacs
  2009-04-06  9:42 ` Daniel Dalton
@ 2009-04-06 14:55   ` Peter Dyballa
  2009-04-06 14:56   ` Renaud Casenave-Péré
  1 sibling, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2009-04-06 14:55 UTC (permalink / raw)
  To: Daniel Dalton; +Cc: help-gnu-emacs


Am 06.04.2009 um 11:42 schrieb Daniel Dalton:

> what's the command to grab an old yank?

First C-y, then M-y until you got what you want.

--
Greetings

   Pete

Think of XML as Lisp for COBOL programmers.
				- Tony-A (some guy on /.)







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

* Re: copying and pasting in emacs
  2009-04-06  9:47 Daniel Dalton
@ 2009-04-06 14:55 ` Alan Mackenzie
  2009-04-06 21:40   ` Daniel Dalton
  0 siblings, 1 reply; 18+ messages in thread
From: Alan Mackenzie @ 2009-04-06 14:55 UTC (permalink / raw)
  To: Daniel Dalton; +Cc: help-gnu-emacs

Hi, Daniel!

On Mon, Apr 06, 2009 at 07:47:44PM +1000, Daniel Dalton wrote:
> On Mon, Apr 06, 2009 at 11:07:41AM +0200, Bourgneuf Francois wrote:
> > Use C-y for pasting (y stands for yank)

> I know I'm going to probably get yelled at, sorry I know I should go
> read the manual, but considering this was asked, what's the command to
> grab an old yank?

M-y.  First do C-y, see that you've yanked the wrong stuff, then do M-y
repeatedly till you get what you want.

> eg. yank something that was cut before the last cut?
> eg. ctr+space ctr+w ctr+k then oh damn, how do I paste that first block
> of text?

> Hope that makes sense!

Absolutely!

> Daniel.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

* Re: copying and pasting in emacs
  2009-04-06  9:42 ` Daniel Dalton
  2009-04-06 14:55   ` Peter Dyballa
@ 2009-04-06 14:56   ` Renaud Casenave-Péré
  1 sibling, 0 replies; 18+ messages in thread
From: Renaud Casenave-Péré @ 2009-04-06 14:56 UTC (permalink / raw)
  To: d.dalton; +Cc: help-gnu-emacs

Just try M-y after a C-y. You can M-y several times.

-- 
Renaud Casenave-Péré

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

* Re: copying and pasting in emacs
  2009-04-06 14:55 ` Alan Mackenzie
@ 2009-04-06 21:40   ` Daniel Dalton
  0 siblings, 0 replies; 18+ messages in thread
From: Daniel Dalton @ 2009-04-06 21:40 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

On Mon, Apr 06, 2009 at 02:55:52PM +0000, Alan Mackenzie wrote:
> Hi, Daniel!

Hi Alan!

> M-y.  First do C-y, see that you've yanked the wrong stuff, then do M-y

Exactly, that works perfectly thanks very much!

> > Hope that makes sense!
> 
> Absolutely!

Great! :-)

Thanks very much,

Cheers,

Daniel.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: copying and pasting in emacs
       [not found] ` <mailman.4658.1238946331.31690.help-gnu-emacs@gnu.org>
@ 2009-05-02 23:50   ` David Combs
  0 siblings, 0 replies; 18+ messages in thread
From: David Combs @ 2009-05-02 23:50 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.4658.1238946331.31690.help-gnu-emacs@gnu.org>,
Nurullah Akkaya  <nurullah@nakkaya.com> wrote:
>-=-=-=-=-=-
>
>On Sun, Apr 5, 2009 at 5:17 PM, <luca.pamparana@gmail.com> wrote:
>
>> Hello,
>>
>> I am unable to figure out how to select and copy text as you would do
>> in another editors:

There's a really great tutorial already built into emacs -- in it, you
learn by doing.

Give it a try!

(You will like it!)

To start it, simply hit C-h  and then  t  (t for tutorial).

Enjoy!

David




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

* Re: copying and pasting in emacs
       [not found] ` <mailman.4706.1239028278.31690.help-gnu-emacs@gnu.org>
@ 2009-05-02 23:59   ` David Combs
  0 siblings, 0 replies; 18+ messages in thread
From: David Combs @ 2009-05-02 23:59 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.4706.1239028278.31690.help-gnu-emacs@gnu.org>,
Daniel Dalton  <d.dalton@iinet.net.au> wrote:
>-=-=-=-=-=-
>
>On Mon, Apr 06, 2009 at 11:07:41AM +0200, Bourgneuf Francois wrote:
>> Use C-y for pasting (y stands for yank)
>
>I know I'm going to probably get yelled at, sorry I know I should go
>read the manual, 

No, take the tutorial (hit C-h t), THEN read the manual.

David




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

end of thread, other threads:[~2009-05-02 23:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-06  9:07 copying and pasting in emacs Bourgneuf Francois
2009-04-06  9:42 ` Daniel Dalton
2009-04-06 14:55   ` Peter Dyballa
2009-04-06 14:56   ` Renaud Casenave-Péré
     [not found] ` <mailman.4706.1239028278.31690.help-gnu-emacs@gnu.org>
2009-05-02 23:59   ` David Combs
  -- strict thread matches above, loose matches on Subject: below --
2009-04-06  9:47 Daniel Dalton
2009-04-06 14:55 ` Alan Mackenzie
2009-04-06 21:40   ` Daniel Dalton
2009-04-05 14:17 luca.pamparana
2009-04-05 14:56 ` Richard Riley
2009-04-05 14:57 ` lore
2009-04-05 15:45 ` Nurullah Akkaya
2009-04-05 16:06 ` rustom
2009-04-05 17:48   ` Drew Adams
2009-04-05 17:53 ` Peter Finn
     [not found] ` <mailman.4665.1238954048.31690.help-gnu-emacs@gnu.org>
2009-04-05 21:43   ` B. T. Raven
2009-04-06  7:29 ` Nikolaj Schumacher
     [not found] ` <mailman.4658.1238946331.31690.help-gnu-emacs@gnu.org>
2009-05-02 23:50   ` David Combs

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.