summaryrefslogtreecommitdiffhomepage
path: root/lib/net/jao-notmuch.el
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/jao-notmuch.el')
-rw-r--r--lib/net/jao-notmuch.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index 1e9eb4c..92ed49f 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -1,6 +1,6 @@
;;; jao-notmuch.el --- Extensions for notmuch -*- lexical-binding: t; -*-
-;; Copyright (C) 2021, 2022 jao
+;; Copyright (C) 2021, 2022, 2023 jao
;; Author: jao <mail@jao.io>
;; Keywords: mail
@@ -363,10 +363,14 @@
;;; results formatters
+(defun jao-notmuch-cmp-tags (a b)
+ (or (> (length a) (length b)) (string-lessp a b)))
+
(defun jao-notmuch-format-tags (fmt msg)
(let ((ts (thread-last (notmuch-tree-format-field "tags" "%s" msg)
(split-string)
- (seq-sort-by #'length #'<))))
+ ;; (seq-sort-by #'length #'<)
+ (seq-sort #'jao-notmuch-cmp-tags))))
(format-spec fmt `((?s . ,(mapconcat #'identity ts " "))))))
(defun jao-notmuch-format-tree-and-subject (fmt msg)