* Alphabetizing comma separated lists
@ 2009-10-07 23:43 James
2009-10-08 3:38 ` Gregory J. Grubbs
0 siblings, 1 reply; 2+ messages in thread
From: James @ 2009-10-07 23:43 UTC (permalink / raw)
To: Help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 161 bytes --]
For example, I want this:
def, acb, lmn, ghi
To appear like this:
acb, def, ghi, lmn
Is there a way to do this in Emacs?
Any help would be appreciated,
James
[-- Attachment #2: Type: text/html, Size: 192 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Alphabetizing comma separated lists
2009-10-07 23:43 Alphabetizing comma separated lists James
@ 2009-10-08 3:38 ` Gregory J. Grubbs
0 siblings, 0 replies; 2+ messages in thread
From: Gregory J. Grubbs @ 2009-10-08 3:38 UTC (permalink / raw)
To: help-gnu-emacs
James <ja.lira0@gmail.com> writes:
> For example, I want this:
> def, acb, lmn, ghi
>
> To appear like this:
> acb, def, ghi, lmn
>
> Is there a way to do this in Emacs?
>
> Any help would be appreciated,
> James
You could highlight the line or lines, then do
--8<---------------cut here---------------start------------->8---
M-: (sort-regexp-fields nil "[a-z]+" "\\&" (region-beginning) (region-end)) RET
--8<---------------cut here---------------end--------------->8---
The above splits the region into fields based on a regexp, and sorts it
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-08 3:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-07 23:43 Alphabetizing comma separated lists James
2009-10-08 3:38 ` Gregory J. Grubbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).