summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2023-11-11 23:07:29 +0000
committerjao <jao@gnu.org>2023-11-11 23:07:39 +0000
commit7e3abb0b8b4c267c8f3d225ef08a403e3242d49c (patch)
treef8b502bbd6eb973ff53b76cac09915b12f97206b
parent84fffc814292567fdeff27c70cb6e738d962c1e0 (diff)
downloadelibs-7e3abb0b8b4c267c8f3d225ef08a403e3242d49c.tar.gz
elibs-7e3abb0b8b4c267c8f3d225ef08a403e3242d49c.tar.bz2
notmuch: tag display order
-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)