From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 2DD216DE0A81 for ; Thu, 27 Feb 2020 12:02:23 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.391 X-Spam-Level: X-Spam-Status: No, score=0.391 tagged_above=-999 required=5 tests=[AWL=-0.261, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y8ObNWASgjd4 for ; Thu, 27 Feb 2020 12:02:22 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 70D506DE0A43 for ; Thu, 27 Feb 2020 12:02:22 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 8B0ED100063; Thu, 27 Feb 2020 22:02:20 +0200 (EET) From: Tomi Ollila To: Mark Walters , notmuch@notmuchmail.org Subject: Re: [PATCH 3/6] Unthreaded mode: allow different result format In-Reply-To: <20200227171652.18187-4-markwalters1009@gmail.com> References: <20200227171652.18187-1-markwalters1009@gmail.com> <20200227171652.18187-4-markwalters1009@gmail.com> User-Agent: Notmuch/0.28.3+84~g41389bb (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 20:02:23 -0000 On Thu, Feb 27 2020, Mark Walters wrote: > It is likely that the user will want a different line format for > unthreaded mode from tree mode; in particular the thread structure > graphics are unnecessary in unthreaded mode. > > Add a new customisable variable and set it to something sensible. Looks good to me (I trust Mark the result format is good) Tomi > --- > emacs/notmuch-tree.el | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el > index 80b830dd..760eaaec 100644 > --- a/emacs/notmuch-tree.el > +++ b/emacs/notmuch-tree.el > @@ -76,6 +76,31 @@ Note the author string should not contain > :type '(alist :key-type (string) :value-type (string)) > :group 'notmuch-tree) > > +(defcustom notmuch-unthreaded-result-format > + `(("date" . "%12s ") > + ("authors" . "%-20s") > + ((("subject" . "%s")) ." %-54s ") > + ("tags" . "(%s)")) > + "Result formatting for unthreaded Tree view. Supported fields are: date, > + authors, subject, tree, tags. Tree means the thread tree > + box graphics. The field may also be a list in which case > + the formatting rules are applied recursively and then the > + output of all the fields in the list is inserted > + according to format-string. > + > +Note the author string should not contain > + whitespace (put it in the neighbouring fields instead). > + For example: > + (setq notmuch-tree-result-format \(\(\"authors\" . \"%-40s\"\) > + \(\"subject\" . \"%s\"\)\)\)" > + :type '(alist :key-type (string) :value-type (string)) > + :group 'notmuch-tree) > + > +(defun notmuch-tree-result-format () > + (if notmuch-tree-unthreaded > + notmuch-unthreaded-result-format > + notmuch-tree-result-format)) > + > ;; Faces for messages that match the query. > (defface notmuch-tree-match-face > '((t :inherit default)) > @@ -759,7 +784,7 @@ unchanged ADDRESS if parsing fails." > ;; We need to save the previous subject as it will get overwritten > ;; by the insert-field calls. > (let ((previous-subject notmuch-tree-previous-subject)) > - (insert (notmuch-tree-format-field-list notmuch-tree-result-format msg)) > + (insert (notmuch-tree-format-field-list (notmuch-tree-result-format) msg)) > (notmuch-tree-set-message-properties msg) > (notmuch-tree-set-prop :previous-subject previous-subject) > (insert "\n"))) > -- > 2.11.0 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch