diff options
| author | jao <jao@gnu.org> | 2026-06-01 21:20:07 +0100 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-06-20 17:07:26 +0100 |
| commit | 137e12bed01bbc24e3172bacf7da8c1988339161 (patch) | |
| tree | 180070e43a24fd9495b21da191501a4bd9caa636 /lib/net | |
| parent | e0ee7a2d9247762d7f5f1d311b81bbf556d55c0d (diff) | |
| download | elibs-137e12bed01bbc24e3172bacf7da8c1988339161.tar.gz elibs-137e12bed01bbc24e3172bacf7da8c1988339161.tar.bz2 | |
notmuch nits
Diffstat (limited to 'lib/net')
| -rw-r--r-- | lib/net/jao-notmuch.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index 404eab7..0f6903a 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, 2023, 2024, 2025 jao +;; Copyright (C) 2021, 2022, 2023, 2024, 2025, 2026 jao ;; Author: jao <mail@jao.io> ;; Keywords: mail @@ -378,16 +378,22 @@ (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 #'jao-notmuch-cmp-tags)))) - (format-spec fmt `((?s . ,(mapconcat #'identity ts " ")))))) + (if (> (window-width) 85) + (let ((ts (thread-last (notmuch-tree-format-field "tags" "%s" msg) + (split-string) + ;; (seq-sort-by #'length #'<) + (seq-sort #'jao-notmuch-cmp-tags)))) + (format-spec fmt `((?s . ,(mapconcat #'identity ts " "))))) + "")) + +(defun jao-notmuch-format-authors (threshold msg) + (let ((fmt (if (< (window-width) threshold) "%-15s" "%-35s"))) + (notmuch-tree-format-field "authors" fmt msg))) (defun jao-notmuch-format-tree-and-subject (_fmt msg) (let ((tr (notmuch-tree-format-field "tree" " %s" msg)) (sb (notmuch-tree-format-field "subject" " %s" msg)) - (fmt (format "%%>-%ds" (- (window-width) 60)))) + (fmt (format "%%>-%ds" (- (window-width) 45)))) (format-spec fmt `((?s . ,(concat tr sb)))))) (defun jao-notmuch-format-msg-ticks (mails-rx msg) |
