sort-lines - Alphabetically sort lines
n sort-lines
sort-lines alphabetically sorts lines of text in the current buffer from the mark position to the current cursor position. If the buffer mode exact(2m) is enabled then the sort is case sensitive, otherwise the sort is case insensitive. By default the text is compared from left to right from column 0 (the left hand edge), if a positive argument n is given then the text is compared left to right from the nth column, any lines shorter than n characters are moved to the top and sorted from column 0.
The following table gives the results of sort-lines for different exact modes and values of n.
_____________________________________________ Original Sorted Lines _____________________________________________ exact - n n y y n - - 1 - n _____________________________________________ B a2 B Aa B CA Aa c B c b1 B b1 CA b1 Aa b1 a2 a2 a2 c c CA b1 CA a2 CA Aa c Aa _____________________________________________
Typically MicroEmacs '99 is executed with exact(2m) mode enabled, the macro command sort-lines-ignore-case provides a command to sort lines case insensitively while exact mode is enabled. The macro is defined as follows:-
define-macro sort-lines-ignore-case set-variable #l0 &bmod exact -1 buffer-mode "exact" !if @? @# sort-lines !else sort-lines !endif &cond #l0 1 -1 buffer-mode "exact" !emacro
sort-lines-ignore-case(3) is a macro defined in format.emf.
(c) Copyright JASSPA 1999
Last Modified: 1998/07/27
Generated On: 1999/12/01