summaryrefslogtreecommitdiffhomepage
path: root/lib/net
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-02-27 20:25:35 +0000
committerjao <jao@gnu.org>2022-02-27 20:25:35 +0000
commita0c179f036e923007dda13f19a92c8c025e7badc (patch)
tree7af472cb58f36bc437aa046d8dbba7f4199cda7e /lib/net
parent8ff802bcb6171af79b965fa2ce954bd5ae2098f2 (diff)
downloadelibs-a0c179f036e923007dda13f19a92c8c025e7badc.tar.gz
elibs-a0c179f036e923007dda13f19a92c8c025e7badc.tar.bz2
notmuch tweaks and right justified counts
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/jao-notmuch.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index f057a55..72ca85b 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -226,11 +226,11 @@
(forward-line 1)))
(when cnt (list total match cnt))))
-(defvar jao-notmuch-header-line-format "%S - %Q [%N / %M / %T] %n / %m / %t")
+(defvar jao-notmuch-header-line-format "%Q [%N / %M / %T] %n / %m / %t")
-(defun jao-notmuch--format-counts (sb query total match new ttotal tmatch tnew)
+(defun jao-notmuch--format-counts (query total match new ttotal tmatch tnew)
(format-spec jao-notmuch-header-line-format
- `((?S . ,sb) (?Q . ,query) (?T . ,total) (?N . ,new) (?M . ,match)
+ `((?Q . ,query) (?T . ,total) (?N . ,new) (?M . ,match)
(?t . ,ttotal) (?n . ,tnew) (?m . ,tmatch))))
(defun jao-notmuch--update-header-line (mb)
@@ -239,11 +239,12 @@
(q (buffer-name)))
(with-current-buffer mb
(when (derived-mode-p 'notmuch-show-mode)
- (let ((s (thread-last (notmuch-show-get-subject)
- (notmuch-show-strip-re)
- (notmuch-sanitize))))
- (setq-local header-line-format
- (apply 'jao-notmuch--format-counts s q nc)))))))
+ (let* ((s (thread-last (notmuch-show-get-subject)
+ (notmuch-show-strip-re)
+ (notmuch-sanitize)))
+ (c (apply 'jao-notmuch--format-counts q nc))
+ (n (max 1 (- (window-width) (string-width s) (string-width c)))))
+ (setq-local header-line-format (concat s (make-string n ? ) c)))))))
(defun jao-notmuch-tree--find-update-header-line (&rest _args)
(when-let ((mb (if (derived-mode-p 'notmuch-show-mode)