From eb97189127f8efeee75a2ebb5b5b48910d389115 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 8 Feb 2018 12:30:38 +0000 Subject: [PATCH] Add sort-symbols and ss alias --- modules/siren-text-manipulation.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/siren-text-manipulation.el b/modules/siren-text-manipulation.el index ddc3af5..18d1fcf 100644 --- a/modules/siren-text-manipulation.el +++ b/modules/siren-text-manipulation.el @@ -72,7 +72,15 @@ See `sort-regexp-fields'." (global-set-key (kbd "C-c /") 'comment-or-uncomment-region-or-line) (global-set-key (kbd "C-c C-/") 'comment-or-uncomment-region-or-line) +;; from: https://www.emacswiki.org/emacs/SortWords +(defun sort-symbols (reverse beg end) + "Sort symbols in region alphabetically, in REVERSE if negative. +See `sort-words'." + (interactive "*P\nr") + (sort-regexp-fields reverse "\\(\\sw\\|\\s_\\)+" "\\&" beg end)) + (defalias 'sw 'sort-words) +(defalias 'ss 'sort-symbols) (provide 'siren-text-manipulation) ;;; siren-text-manipulation.el ends here