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

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

Re: indenting automatically after pasting in c-mode


From: Colin S. Miller
Subject: Re: indenting automatically after pasting in c-mode
Date: Wed, 12 Aug 2009 16:08:37 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Dirk80 wrote:
Hi,

I use emacs mainly to write c-code.
For example I paste 10 lines of code into a function. Now this 10 lines of
code are just inserted into the buffer as they are and not indented. I have
to mark these 10 lines, and then pressing TAB (indent-for-tab-command) and
everything is fine.

It would be great if the 10 lines would be intended automatically (without
marking the 10 lines and then pressing tab) when I paste them.

How could I solve this? Do I have to write an own elisp-function which is
doing the job and then binding it in c-mode to C-y. Or is this behaviour
already implemented?

Thanks for your answers.
Dirk

Not sure if it help much,
but ident-region will reindent a block of text correctly.


HTH,
Colin S. Miller

--
Replace the obvious in my email address with the first three letters of the 
hostname to reply.


reply via email to

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