From 7e3abb0b8b4c267c8f3d225ef08a403e3242d49c Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 11 Nov 2023 23:07:29 +0000 Subject: notmuch: tag display order --- lib/net/jao-notmuch.el | 8 ++++++-- 1 file 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 ;; 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) -- cgit v1.2.3