I know that you can do the following to sort-lines in emacs without case sensitivity:
M-x set-variable [RETURN] sort-fold-case [RETURN] t [RETURN] M-x sort-lines M-x set-variable [RETURN] sort-fold-case [RETURN] nil [RETURN]
But this is annoying to do every time. How can I turn this into a function so that I don't have to do the same thing over and over?
Pretty straightforward:
(defun sort-lines-nocase () (interactive) (let ((sort-fold-case t)) (call-interactively 'sort-lines)))
If you always want to sort case insensitive, try this in a file used on startup:
(custom-set-variables '(sort-fold-case t t) )
Then you can just call M-x sort-lines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With