From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6NKwERMWrF7FXAAA0tVLHw (envelope-from ) for ; Fri, 01 May 2020 12:29:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id iJcrCh0WrF4tcAAAbx9fmQ (envelope-from ) for ; Fri, 01 May 2020 12:29:17 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3011F9435CB for ; Fri, 1 May 2020 12:29:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 03C716DE13BA; Fri, 1 May 2020 05:29:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 3zSoZ7G0pVSa; Fri, 1 May 2020 05:29:09 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 9894F6DE1389; Fri, 1 May 2020 05:29:08 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 6BBFB6DE1389 for ; Fri, 1 May 2020 05:29:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 DzHRWI60djHU for ; Fri, 1 May 2020 05:29:05 -0700 (PDT) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) by arlo.cworth.org (Postfix) with ESMTPS id 0AFE16DE10AD for ; Fri, 1 May 2020 05:29:05 -0700 (PDT) Received: by mail-qv1-f43.google.com with SMTP id q2so4636588qvd.1 for ; Fri, 01 May 2020 05:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=7nOvPpM7UJzJTDmsk3smR9HY7nIyolLfTr7L8J0jOBA=; b=hXU6zfI3I0tsq7GoBfyVlfLMTwRtITk9UgPEGCsR9MwRBypHFcd2tBFRirhUYQIFA5 D/qOeNeUYmzaZa5b5cEmMDKov+dfDzuhFJhrDnze+xc3Tn1erGUp3BmRsEiS0JI7MytZ 2dI4rrEurT/77wsr9oF0ZUDooRP8s2+TPcV+lKXRAc2xWlsSvloyVEAbuaYqu6h3ae34 hfh4bvQdI8nm3Bqrc+5uiEB0vjIrKWHwD5MP9xIEZpnDt0FeGShJI5PEEjCUuQuWYo8R WGpbKyMmqLd9+w4zogEwI0AnFZCEeh71ZU0kJqrkRoNfdBSRjdLphBAYuCZ7QG5R0MJf hllw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=7nOvPpM7UJzJTDmsk3smR9HY7nIyolLfTr7L8J0jOBA=; b=sHZuMj091o2WC/eneq3IK0cqGAqr9n/zVexjJVR3rge/TCju/yEJgngyFHhHI3tUMb UvMdePdbULn2rkQV1Rwo4EOhNCdwgKKrWpl3dfnEXF8ZoZPA64KQnO0t776DKiMgSnAa FuKMkVlfoC9sZ8QTKkF95B5z924VW0xTC+HHNJQrrU+5KuM3VJWNSw5V7Ig+eRGz/OIv ER/nUdsJV/wOwWJ8u8siXylTtHWWg5fyHxxPBnoifbZT6eK9HTGQ1phZVyaTOd07e/ii Az3lM4tM4iZIOPnKKJzA5RucghCcaWTV/XlpOLnUpItlPu8tfem5X23uPUryFJQcelHs hkSQ== X-Gm-Message-State: AGi0PuY6+FqlS4cJnV9wD4VyaRZm4AT1Ci44Wx4xwtrV4cOjZWEQNRl2 fF5iokw0HhBPkylaltvHxX3KMr+uWxtFAorAj26J8Q== X-Google-Smtp-Source: APiQypJpFlCwD5Ax0aalFzqodX84+Rm7htDCiNiCjv+nezHn4PQz4zZuWbRVZq7gNUUWVtDtOx2xmR8VH99btAaAe/E= X-Received: by 2002:a05:6214:7a7:: with SMTP id v7mr3788742qvz.27.1588336143891; Fri, 01 May 2020 05:29:03 -0700 (PDT) MIME-Version: 1.0 From: Ciprian Dorin Craciun Date: Fri, 1 May 2020 15:28:27 +0300 Message-ID: Subject: Add support for `--limit=N` to `notmuch show` To: notmuch@notmuchmail.org 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=hXU6zfI3; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [0.09 / 13.00]; GENERIC_REPUTATION(0.00)[-0.46797183709588]; DWL_DNSWL_FAIL(0.00)[50.126.95.6:server fail]; R_SPF_ALLOW(-0.20)[+a:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.00), ip: 50.126.95.6(-0.47)]; DKIM_TRACE(0.00)[gmail.com:-]; MX_GOOD(-0.50)[cached: notmuchmail.org]; MAILLIST(-0.20)[mailman]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cipriancraciun@gmail.com,notmuch-bounces@notmuchmail.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[notmuchmail.org:email]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; DNSWL_BLOCKED(0.00)[50.126.95.6:from]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: z/kk7Rbje8BS In a previous email (about `thread:...` field in JSON output of `notmuch show`), I described one of my use-cases for notmuch. Now extending upon that, if one would to implement an email client that provides the user with search, there are two approaches: * use `notmuch search -- {query}` and based on that output display a thread list like GMail does; * use `notmuch show -- {query}` and based on that display a page with all emails that matched, grouping them by thread; (I prefer this variant, as it gives me a quicker glance if I search for something specific;) Now the problem with `notmuch show` is that if I give it a too "broad" query like `*` it will chew a lot of CPU and RAM (and in my case eventually crash). `notmuch search` does have a `--limit=N` argument that limits the search output only to the first `N` items. My feature request is to add such a flag also to `notmuch show` that should: * limit the number of threads in all cases except `--format=raw`; * not be allowed in case of `--format=raw` or `--part=P`; As a work-around I could use `notmuch search --output=threads --limit={limit} -- {query}`, then take those thread ID's and issue an `notmuch show -- thread:... thread:...`. But this has the following problems: * it requires two `notmuch` CLI calls; * and most importantly it renders the `--entire-thread=false` feature useless; (as not the entire threads are matched by `notmuch show` as opposed only to those matched by `notmuch search`;) Thanks, Ciprian.