summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-01-17 22:14:27 -0500
committerKyle Meyer <kyle@kyleam.com>2015-01-17 22:14:27 -0500
commit67fecc8215df51288025029ed057df78a6f4ea79 (patch)
treedd4f8f227622dd89a975ef1c18e8b86023bfe5f9
parent74aa350f0ba0be8827f63c998dd6e483f892e299 (diff)
downloademacs.d-67fecc8215df51288025029ed057df78a6f4ea79.tar.gz
gnus: Add function to sort by topic
-rw-r--r--lisp/init-gnus.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/init-gnus.el b/lisp/init-gnus.el
index 1ca5ec9..8fdc85a 100644
--- a/lisp/init-gnus.el
+++ b/lisp/init-gnus.el
@@ -80,6 +80,18 @@
(add-hook 'message-send-hook 'km/message-confirm-sender)
+(autoload 'gnus-group-topic "gnus-topic")
+
+(defun km/gnus-group-sort-by-topic (info1 info2)
+ "Sort alphabetically by group topic.
+This allows groups to be ordered by topics even when topic mode
+is off."
+ (string< (gnus-group-topic (gnus-info-group info1))
+ (gnus-group-topic (gnus-info-group info2))))
+
+(setq gnus-group-sort-function '(km/gnus-group-sort-by-topic
+ gnus-group-sort-by-level))
+
(add-hook 'message-mode-hook
(lambda () (flyspell-mode 1)))