Re: configurable summary line for notmuch search

Subject: Re: configurable summary line for notmuch search

Date: Sat, 28 Aug 2021 20:46:17 -0400

To: Jose Antonio Ortega Ruiz, David Bremner, notmuch@notmuchmail.org

Cc:

From: Roger Randall


Jose Antonio Ortega Ruiz <jao@gnu.org> writes:

> On Sat, Aug 28 2021, David Bremner wrote:
>
>> I was idly thinking about how to provide custom summary formats for
>> notmuch-search. I know this has been discussed a few times on IRC, but I
>> can't remember the kind of things people were looking for. So if this a
>> feature you're interested in, what specifically are you looking for?
>
> I actually have a patch in my queue that implements a form of this, in
> two ways.  By allowing the "field" to be a function that gets called with
> the message property and returns a string, and by allowing the format
> string to be a function that takes the value of the field and further
> formats it.  This is the relevant patch with simple examples in the
> documentation:
>
>   https://jao.io/cgit/notmuch/commit/?h=tree-result-format&id=0d7d909aa8bc4fb8e5ab80f93bc397fbed666761
>
> and this is an example of how i use it to have a marker in my result
> lists that tells me if i'm the recipient of the displayed email and to
> trunctate the subject to a maximum length:
>
>       (setq notmuch-tree-result-format
>             '(("date" . "%12s  ")
>               ("authors" . "%-35s")
>               (jao-notmuch-msg-ticks)
>               ("subject" . jao-notmuch-truncate)
>               ("tags" . "  (%s)")))
>
>       (defun jao-notmuch-msg-ticks (msg)
>         (let ((headers (plist-get msg :headers)))
>           (cond ((string-match-p jao-mails-regexp (or (plist-get headers :To) ""))
>                  (propertize " »" 'face 'notmuch-tree-match-tree-face))
>                 ((string-match-p jao-mails-regexp (or (plist-get headers :Cc) ""))
>                  (propertize " ¬" 'face 'notmuch-tree-match-tree-face))
>                 (t "  "))))
>
>       (defun jao-notmuch-truncate (x)
>         (truncate-string-to-width (format "%-102s" x) 102 nil nil t))
>
> what do you think?
>
> cheers,
> jao
> -- 
> I never lose sight of the fact that just being is fun.
>   -Katharine Hepburn, actress (1907-2003)
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

I greatly desire the ability to limit the subject length so (in my case)
tags consistently line-up in the same column.

Along those lines, I would also like the ability to
explicitly set the order in which tags are shown in notmuch-search (as
opposed to purely alphabetical). 
 - RER
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: