C-h f sort-columns:
sort-columns is an interactive autoloaded compiled Lisp function in
It is bound to
menu-bar edit sort sort-columns.
(sort-columns REVERSE &optional BEG END)
Sort lines in region alphabetically by a certain range of columns.
For the purpose of this command, the region
the entire line that point is in and the entire line the mark is in.
The column positions of point and mark bound the range of columns to sort on.
A prefix argument means sort into
sort-fold-case determines whether alphabetic case affects
the sort order.
sort-columns rejects text that contains tabs,
because tabs could be split across the specified columns
and it doesn't know how to handle that. Also, when possible,
it uses the
sort utility program, which doesn't understand tabs.
Use M-x untabify to convert tabs to spaces before sorting.
See also the Elisp manual, node Sorting:
sort-columns reverse &optional beg end
This command sorts the lines in the region between
end, comparing them alphabetically by a certain range of columns. The column positions of
end bound the range of columns to sort on.
reverse is non-
nil, the sort is in reverse order.
One unusual thing about this command is that the entire line containing position beg, and the entire line containing position end, are included in the region sorted.
sort-columns rejects text that contains tabs, because tabs could be split across the specified columns. Use
M-x untabify to convert tabs to spaces before sorting.
When possible, this command actually works by calling the
sort utility program.