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 ms0.migadu.com with LMTPS id MNExGK93v2GqcAAAgWs5BA (envelope-from ) for ; Sun, 19 Dec 2021 19:19:27 +0100 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 CFCyE693v2EaCwAAbx9fmQ (envelope-from ) for ; Sun, 19 Dec 2021 18:19:27 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1E7204275 for ; Sun, 19 Dec 2021 19:19:27 +0100 (CET) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3A3DC27E22; Sun, 19 Dec 2021 13:19:13 -0500 (EST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 6787727E1E for ; Sun, 19 Dec 2021 13:19:05 -0500 (EST) Received: by fethera.tethera.net (Postfix, from userid 1001) id 81A675FC42; Sun, 19 Dec 2021 13:19:04 -0500 (EST) Received: (nullmailer pid 115977 invoked by uid 1000); Sun, 19 Dec 2021 18:19:03 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Partial support for sorting the output of notmuch address Date: Sun, 19 Dec 2021 14:18:51 -0400 Message-Id: <20211219181854.115918-1-david@tethera.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: AW7JUBRRBJOITLTRWOVVOTHECVC7ZEP5 X-Message-ID-Hash: AW7JUBRRBJOITLTRWOVVOTHECVC7ZEP5 X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: FR ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639937967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=ARb4fYYDqnIuh/nxpSp8xverdh/u5RnIcPe/+c8JCpw=; b=P+nIKpdl7nsVPBgL/nt+rQW8tlULgb3CL50tiZ2z4o2ICZDfgFw7Bpw97WBVQAQmKLUOn1 TBGVRExoEWXPQgFpAHnzdsYGNAWdKCTh955XfJs8eZeyMEuUJtroRA9tHvgbajOQnCVM30 hp9Qz0oNfDUbBs/5MiaZPUOuP803mCjf3kDTdUd5mU4BLm5HYnj+3AMijUa070AGt+GFj3 wajgFNWRO7Xspx1sw7H1HNj+v9Pjq9cOxV5Q9NVo4I9RjeHumVnHOMILqXObCd/yvICfcv tdhnBCTnpF4OW6spwZ4rptyaDl+8eS5fg9M5Q6upK/fo/gXm7x8UGtDRri3CPA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639937967; a=rsa-sha256; cv=none; b=HhIYSssUpf5Be3xGsE28MtxLbvTggcj+jC8LWnS5QIu1rgPxQheFvQW7HaPBIIWSKlRaCq MUmG+p01zDs7b5veqO+6k0NmzLeotHDCc9nQ7oRxMIdk1GQGOxpUHOpdSCYC6NTF4WN8JA n2WvnR7uAbOnjoX+ne2opa51oB7wR7TXSle7ioA6IDeHlRvu3kezO7NrVtoEHDV6G1clmn isEBMKP61Kl+6L6DOgU15R/KICJCSyNVwrzgr200w0FRdnSHwHoRD8jnPuU49H4tSZv9L0 cXahJp1RPn0TB/c+1I/ynLVoNwYzcjQbO0VyOWB3e4fGFwUwTiQm1Y+opWaEbg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 2.50 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 1E7204275 X-Spam-Score: 2.50 X-Migadu-Scanner: scn0.migadu.com X-TUID: xjz1aDHF6T7U One of the annoyances with notmuch-address (and motivations for various third party work-a-likes) is the fact that it does not output data in (descending) frequency order. This series adds that for either --output=count or --deduplicate=address. This is because the current --dedup=mailbox handling does not actually count the occurences. I see two ways to go here 1) Unify the handling of --dedup={mailbox,address}. This will probably yield a performance hit for dedup=mailbox. How big probably depends on how many duplicates you have. The main difference would be that the output would all arrive at the end, like with --dedup=address. If people are using --dedup=mailbox for large queries, now is the time to speak up. I noticed the builtin completion in notmuch-emacs is already using --deduplicate=address, so probably no change there. 2) Apply something like this series, and deal with questions from users confused by why only one of the deduplication options, or output=count, sorts. At least in my tests, there does not seem to be a noticable performance hit for the current series. I'm also interested to know if other people do notice such a hit.