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 955106DE00B8 for ; Sat, 10 Jun 2017 17:40:38 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[AWL=0.010, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 y259e5Kzrn9X for ; Sat, 10 Jun 2017 17:40:38 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id ED3536DE00AC for ; Sat, 10 Jun 2017 17:40:37 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1dJqsl-0000z3-IZ; Sat, 10 Jun 2017 20:37:31 -0400 Received: (nullmailer pid 14878 invoked by uid 1000); Sun, 11 Jun 2017 00:40:34 -0000 From: David Bremner To: Ioan-Adrian Ratiu , notmuch@notmuchmail.org Subject: Re: [PATCH v2 10/11] emacs: notmuch-search: add display thread sizes capability In-Reply-To: <20170518222708.30032-11-adi@adirat.com> References: <20170518222708.30032-1-adi@adirat.com> <20170518222708.30032-11-adi@adirat.com> Date: Sat, 10 Jun 2017 21:40:34 -0300 Message-ID: <878tkzcq65.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Sun, 11 Jun 2017 00:40:38 -0000 Ioan-Adrian Ratiu writes: > By default this is off because it's tiresome to look at all those > numbers in every search view. It's much more pleasant to have it > enabled by default in notmuch-show even if you apply searches and sort > results based on file size. > > Signed-off-by: Ioan-Adrian Ratiu > --- > emacs/notmuch.el | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index 5b9c1d07..dbcd67eb 100644 > --- a/emacs/notmuch.el > +++ b/emacs/notmuch.el > @@ -73,7 +73,7 @@ > ("subject" . "%s ") > ("tags" . "(%s)")) > "Search result formatting. Supported fields are: > - date, count, authors, subject, tags > + date, count, total_filesize, authors, subject, tags > For example: > > (defun notmuch-search-insert-field (field format-string result) > (cond > + ((string-equal field "total-filesize") > + (insert (propertize (format format-string (file-size-human-readable (plist-get result :total_filesize))) > + 'face 'notmuch-search-thread-total-filesize))) there seems to be some confusion here about total-filesize and total_filesize; I guess the docstring for the variable should match the string-equal test.