[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: yank-and-indent
From: |
Arnaldo Mandel |
Subject: |
Re: yank-and-indent |
Date: |
Wed, 20 Nov 2002 19:43:57 -0200 |
Michael Slass wrote (on Nov 20, 2002):
> "Timur Aydin" <asdfweasdf@diowekfsdf.dersdre> writes:
>
> >Hi,
> >
> >In programming, very often a number of lines are killed, yanked to another
> >location and are reindented according to the new location. Currently, the
> >following sequence has to be done manually:
> >
> >1) Mark the lines to be killed
> >2) Kill the lines
> >3) Yank into new location
> >4) Mark the same lines again.
> >5) Hit C-M-\ to indent the lines according to new location.
> >
> >I would like to reduce the procedure to:
> >
> >1) Mark the lines to be killed
> >2) Kill the lines
> >3) Hit ???? to yank and indent the lines.
> >
> >Any wisdom on how this can be accomplished? I am a beginner in lisp, so
> >hopefully there is a way that doesn't require writing a lisp function...
> >
> >--
> >Timur
> >
> >
>
> Try this:
>
> (defun yank-and-indent ()
> "Yank and indent yanked material according to mode."
To me this seems excessive: one more function and one more binding to
remember.
What Timur should realize is that step (4) is superfluous - the yanked
lines form the region immediately after yanking. So, ???? is simply
C-y M-C-\
am
--
Arnaldo Mandel
Departamento de Ciência da Computação - Computer Science Department
Universidade de São Paulo, Bra[sz]il
am@ime.usp.br