[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to reverse a region of several words?
From: |
Thierry Volpiatto |
Subject: |
Re: how to reverse a region of several words? |
Date: |
Mon, 28 Jul 2008 11:03:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
sunway <sunwayforever@gmail.com> writes:
> e.g. the region contains words like "aaa bbb ccc ddd",I want to
> reverse it to "ddd ccc bbb aaa"
>
kill your region with some kill func (check elisp man)
and store it (A)
Be sure to remember the position of your text.
,----
| ELISP> (setq A "aaa bbb ccc ddd")
| "aaa bbb ccc ddd"
| ELISP> (setq A (split-string A))
| ("aaa" "bbb" "ccc" "ddd")
|
| ELISP> (setq A (reverse A))
| ("ddd" "ccc" "bbb" "aaa")
|
| ELISP> (mapconcat #'(lambda (x) x) A " ")
| "ddd ccc bbb aaa"
`----
And now insert the new text at the saved position.
--
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France
- how to reverse a region of several words?, sunway, 2008/07/28
- Re: how to reverse a region of several words?,
Thierry Volpiatto <=
- Re: how to reverse a region of several words?, tyler, 2008/07/28
- Re: how to reverse a region of several words?, Pascal J. Bourguignon, 2008/07/28
- Message not available
- Re: how to reverse a region of several words?, sunway, 2008/07/28
- Re: how to reverse a region of several words?, Thierry Volpiatto, 2008/07/29
- Re: how to reverse a region of several words?, Pascal J. Bourguignon, 2008/07/29
- Re: how to reverse a region of several words?, sunway, 2008/07/30
- Re: how to reverse a region of several words?, Pascal J. Bourguignon, 2008/07/30
- Re: how to reverse a region of several words?, Thierry Volpiatto, 2008/07/30