From xradiograph

Emacs: Sorting

General

Sorting Records With Emacs
EmacsWiki:SortWords

 

 

Case insensitive sort-lines in emacs.

 

M-x set-variable [RETURN] sort-fold-case [RETURN] t [RETURN]
M-x sort-lines

 

(source)

 

 

also:

 

(defun sort-lines-nocase ()
  (interactive)
  (let ((sort-fold-case t))
    (call-interactively 'sort-lines)))

 

(source)

 

This suggests another function that takes an optional (M-u) arg to sort insensitively...

 

 

sort by “rhyme” -- really, by word-endings

 

(setq words "haters gonna hate....")
(apply 'string (reverse (string-to-list words)))
delete quotes
select region
M-x sort-lines
add quotes
setq words
(apply 'string (reverse (string-to-list words)))

 

See my original blog post for examples

 

 

See Also

RegularExpressions

 

 

Tags

Emacs textprocessing

Retrieved from http://www.xradiograph.com/Emacs/Sorting
Page last modified on February 18, 2014, at 10:16 AM