From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IFENHa/n+2GFJgEAgWs5BA (envelope-from ) for ; Thu, 03 Feb 2022 15:33:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QM+aGa/n+2HnvQAAauVa8A (envelope-from ) for ; Thu, 03 Feb 2022 15:33:19 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 185823A1D9 for ; Thu, 3 Feb 2022 15:33:19 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 2005C5F713; Thu, 3 Feb 2022 14:33:05 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 267955F708 for ; Thu, 3 Feb 2022 14:33:01 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 68E295FBD4; Thu, 3 Feb 2022 09:33:00 -0500 (EST) Received: (nullmailer pid 3348413 invoked by uid 1000); Thu, 03 Feb 2022 14:32:56 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [RFC PATCH v2 07/12] emacs: remove non-batch code path from function notmuch-tag Date: Thu, 3 Feb 2022 10:32:49 -0400 Message-Id: <20220203143254.3344753-8-david@tethera.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203143254.3344753-1-david@tethera.net> References: <20220203143254.3344753-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: V7YZDHQZETCYP45EXKVMD3BH2X5C6XQ7 X-Message-ID-Hash: V7YZDHQZETCYP45EXKVMD3BH2X5C6XQ7 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: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643898799; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=GiUzF6QZdTLyGnqv5C2lxeN3kOCGJLXqs2eLtfOTid4=; b=b7vb7liZgGBp8e2xTBhvaMunNqkNw3wSe+9xxEiDEtUKPr+L+yYyVEaCvlyX1uDjwInh9z IglvKSSTxE1LdQKlU9naqRyLSwe30riJhOPNhHuNtr5EhtXsX/pYsEru9EhpJ7fFrmGXUt jnHtQCzVmnX6SZC6M6ltdT9z6yGoWxQ0MZDnYGw8iRYWKy8OSQUBTVKTgrONgbqhyNhX3A GTfhX54pkM4R0nEw7fVv7Jx/R40hzRFMBOC5FdU7HwH+91WEK+6vHsn+yNCEUY/aJebYNW bu+j3nguz4ZZWglTQWAX+QGoIo03xW/YcBp0BG374JFKU9I+STlwXd+fHvWdWw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643898799; a=rsa-sha256; cv=none; b=h314Nsoy8AbNgF+rrh0lgJPQYQJGkRtLhUtHvWiVg7owt7/05NwtOMXPMUQUjm8zBCxXS7 o3R350zFjC5dKbR9BH5I7ZrLlbB1PUF7Xw1hTpalnwk5dJ5KVkdPNDtjHHlHG5vFKKLix7 EsB7IzFWTw8L5s72wDQPSg6j+FyyhFiOjaesBoRIrx1IclofdP7hTRIaTdGiIQ4AM+wBuX 5Ao1OtX3RCH3/0U9a5pCqiFKiu93m1G28bKNNsaQ2C3n6Zfe9sUeyORQVV8n/QJiAL7kSk rf3fK5uLblykkP1iLvQRweXBi8LaOZ51RNG/Ze+AmxINyxlB9jiIDZ7U3YpJcw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.35 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 185823A1D9 X-Spam-Score: -1.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: pdKGAELtZF8W It is no slower (according to T06-emacs) to use batch for everything, and it simplifies the code. --- emacs/notmuch-tag.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el index 8af09e68..ad0cb1c1 100644 --- a/emacs/notmuch-tag.el +++ b/emacs/notmuch-tag.el @@ -458,7 +458,11 @@ from TAGS if present." "Use batch tagging if the tagging query is longer than this. This limits the length of arguments passed to the notmuch CLI to -avoid system argument length limits and performance problems.") +avoid system argument length limits and performance problems. + +NOTE: this variable is no longer used.") + +(make-obsolete-variable 'notmuch-tag-argument-limit nil "notmuch 0.36") (defun notmuch-tag (query tag-changes) "Add/remove tags in TAG-CHANGES to messages matching QUERY. @@ -481,16 +485,13 @@ notmuch-after-tag-hook will be run." (notmuch-dlet ((tag-changes tag-changes) (query query)) (run-hooks 'notmuch-before-tag-hook)) - (if (<= (length query) notmuch-tag-argument-limit) - (apply 'notmuch-call-notmuch-process "tag" - (append tag-changes (list "--" query))) - ;; Use batch tag mode to avoid argument length limitations - (let ((batch-op (concat (mapconcat #'notmuch-hex-encode tag-changes " ") - " -- " query))) - (notmuch-call-notmuch-process :stdin-string batch-op "tag" "--batch"))) - (notmuch-dlet ((tag-changes tag-changes) + ;; Use batch tag mode to avoid argument length limitations + (let ((batch-op (concat (mapconcat #'notmuch-hex-encode tag-changes " ") + " -- " query))) + (notmuch-call-notmuch-process :stdin-string batch-op "tag" "--batch"))) + (notmuch-dlet ((tag-changes tag-changes) (query query)) - (run-hooks 'notmuch-after-tag-hook)))) + (run-hooks 'notmuch-after-tag-hook))) (defun notmuch-tag-change-list (tags &optional reverse) "Convert TAGS into a list of tag changes. -- 2.34.1