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 4D7906DE0314 for ; Mon, 22 May 2017 06:40:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.241 X-Spam-Level: X-Spam-Status: No, score=0.241 tagged_above=-999 required=5 tests=[AWL=0.262, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] 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 kcnXhiIvaNJC for ; Mon, 22 May 2017 06:40:08 -0700 (PDT) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by arlo.cworth.org (Postfix) with ESMTPS id D26A36DE0191 for ; Mon, 22 May 2017 06:40:07 -0700 (PDT) Received: by mail-wm0-f66.google.com with SMTP id k15so32096527wmh.3 for ; Mon, 22 May 2017 06:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adirat-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=Zm6hGlBABS1hIGiGLIFtsDrI9Fl7tP7KSN+mjIi5NHQ=; b=MYp3tmO19HD8XnqdjT7tPYZKt2k4a1ACu0EO2oZqaZxgea3GiOLUYgefly9H9ws11Y sz1GsblQG9aT3/ZezbsoZqwr/DFg5djPLmNHOXTGMLZ/Ep2+goFxKGyd+mhY8R8I0Di+ xtyg6kh5GYYBMjiJ7Y75t9frvvUch5gOMgbzUwSukhAOcg/jGz64OxO3t+6+C9+YRLVV b/nAtl6CSvCXWgORudP186OSUEzaWSIQ85Qh67DM+bHsDowhZdZOz2LDD88FNVYeOdhA IZoVQstKkY+WL0WeEzk07a5r9qLfQdZeapj0SYu8TUu2szb5aMuLv2pJzAE+LduzlEyR KIAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=Zm6hGlBABS1hIGiGLIFtsDrI9Fl7tP7KSN+mjIi5NHQ=; b=ohqghz/JJ7r5JziiYYy41QxW7Djy4M0+Q1BmdpdRxiqdRfCLhAXbELMxrX4XzT1FSD OkAdMJKUoPtSO7RMr8d3MOIdeUQOFurQqVf/0ut0T4c1fSWk5Youqm9X1YgovTTFndls yoCbrIxLjeUZAat202s0xzupEjmBd1r1AZh4fsH4DgzkFD+CCe0UcrxubM0s8DPDfbFb Mog/jKTisZ8xA8ZO+ARR2Qm0Ua9JOR1mYFSAen0eG9d0QGxpq6TK7FwL6phj6OYALEKB nHViA3WxnqGdIyU6P8JADDKvgnrmFdAzbQrjtMjlu+7jNkMd3mjqHe8FipvYimiWtGNj HjwA== X-Gm-Message-State: AODbwcAWzvw53gLJ4twuSUIaPO0XxeV7CDX8a8po9H2v0+cU5rTsgsfT NkZFFnkXw1uiU8iX X-Received: by 10.28.0.13 with SMTP id 13mr261649wma.19.1495460404796; Mon, 22 May 2017 06:40:04 -0700 (PDT) Received: from adi-pc-linux ([80.97.64.55]) by smtp.gmail.com with ESMTPSA id x24sm426897wma.7.2017.05.22.06.40.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 May 2017 06:40:04 -0700 (PDT) From: Ioan-Adrian Ratiu To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH v2 03/11] notmuch-search: add filesize based sort order In-Reply-To: References: <20170518222708.30032-1-adi@adirat.com> <20170518222708.30032-4-adi@adirat.com> Date: Mon, 22 May 2017 16:37:40 +0300 Message-ID: <87bmqlrp0b.fsf@ni.com> 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: Mon, 22 May 2017 13:40:09 -0000 On Fri, 19 May 2017, Tomi Ollila wrote: > On Fri, May 19 2017, Ioan-Adrian Ratiu wrote: > >> With this it now becomes possible to order the search results by >> filesize using the --sort=biggest-first/smallest-first args. > > Quick drive-by comment (for now): In many places elsewhere we're talking > about 'large' files (e.g. LARGEFILE_SOURCE...) so should we use that > terminology here too (?) instead of 'big*' Sure. I'll update to use 'large' in v3, but I'll wait a little longer to get more feedback on v2 before sending it because it's a small change. Ionel > > Tomi > > >> >> Signed-off-by: Ioan-Adrian Ratiu >> --- >> lib/notmuch.h | 8 ++++++++ >> lib/query.cc | 6 ++++++ >> notmuch-search.c | 2 ++ >> 3 files changed, 16 insertions(+) >> >> diff --git a/lib/notmuch.h b/lib/notmuch.h >> index f90458ce..b7bf3526 100644 >> --- a/lib/notmuch.h >> +++ b/lib/notmuch.h >> @@ -743,6 +743,14 @@ typedef enum { >> */ >> NOTMUCH_SORT_MESSAGE_ID, >> /** >> + * Smallest first. >> + */ >> + NOTMUCH_SORT_SMALLEST_FIRST, >> + /** >> + * Biggest first >> + */ >> + NOTMUCH_SORT_BIGGEST_FIRST, >> + /** >> * Do not sort. >> */ >> NOTMUCH_SORT_UNSORTED >> diff --git a/lib/query.cc b/lib/query.cc >> index 9c6ecc8d..72b725e3 100644 >> --- a/lib/query.cc >> +++ b/lib/query.cc >> @@ -330,6 +330,12 @@ _notmuch_query_search_documents (notmuch_query_t *query, >> case NOTMUCH_SORT_MESSAGE_ID: >> enquire.set_sort_by_value (NOTMUCH_VALUE_MESSAGE_ID, FALSE); >> break; >> + case NOTMUCH_SORT_SMALLEST_FIRST: >> + enquire.set_sort_by_value (NOTMUCH_VALUE_FILESIZE, FALSE); >> + break; >> + case NOTMUCH_SORT_BIGGEST_FIRST: >> + enquire.set_sort_by_value (NOTMUCH_VALUE_FILESIZE, TRUE); >> + break; >> case NOTMUCH_SORT_UNSORTED: >> break; >> } >> diff --git a/notmuch-search.c b/notmuch-search.c >> index 019e14ee..65ecfaab 100644 >> --- a/notmuch-search.c >> +++ b/notmuch-search.c >> @@ -778,6 +778,8 @@ static const notmuch_opt_desc_t common_options[] = { >> { NOTMUCH_OPT_KEYWORD, &search_context.sort, "sort", 's', >> (notmuch_keyword_t []){ { "oldest-first", NOTMUCH_SORT_OLDEST_FIRST }, >> { "newest-first", NOTMUCH_SORT_NEWEST_FIRST }, >> + { "smallest-first", NOTMUCH_SORT_SMALLEST_FIRST }, >> + { "biggest-first", NOTMUCH_SORT_BIGGEST_FIRST }, >> { 0, 0 } } }, >> { NOTMUCH_OPT_KEYWORD, &search_context.format_sel, "format", 'f', >> (notmuch_keyword_t []){ { "json", NOTMUCH_FORMAT_JSON }, >> -- >> 2.13.0 >> >> _______________________________________________ >> notmuch mailing list >> notmuch@notmuchmail.org >> https://notmuchmail.org/mailman/listinfo/notmuch > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch