From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YIFgJ3sYCGLtyQAAgWs5BA (envelope-from ) for ; Sat, 12 Feb 2022 21:28:43 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id mNU1IHsYCGKNvgAAG6o9tA (envelope-from ) for ; Sat, 12 Feb 2022 21:28:43 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 1FB262BEC1 for ; Sat, 12 Feb 2022 21:28:43 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 9C4605F731; Sat, 12 Feb 2022 20:28:38 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 5B93D5F728 for ; Sat, 12 Feb 2022 20:28:36 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 9154E5FBD4; Sat, 12 Feb 2022 15:28:35 -0500 (EST) Received: (nullmailer pid 2577360 invoked by uid 1000); Sat, 12 Feb 2022 20:27:56 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH v4 06/11] emacs: remove non-batch code path from function notmuch-tag Date: Sat, 12 Feb 2022 16:27:37 -0400 Message-Id: <20220212202742.2577237-7-david@tethera.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220212202742.2577237-1-david@tethera.net> References: <20220212202742.2577237-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: INJVGYGQCB7E2C4VEW4CA7SF2TAAX7HW X-Message-ID-Hash: INJVGYGQCB7E2C4VEW4CA7SF2TAAX7HW 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=1644697723; 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=p3hwgjvfdEFENdAAs7vw6SXtzseY7bGy2q2yv8Va90F4PWXa9/s/PemxykN5FwwxelYKoS D5Adxbd9snmjSdRhfwczpjykwEBMkvn7a1tiQmBiFXxBDEb+B1PApeDw29JDeixbuxmyiD IbGKYuEUnduhcn33NRYczwfKo8bfFLt02KlxCWjqZOIqiJNlpwCVb2VTtlgQCTS+KtqRi4 y2L7O17pgYaAJIHhBLcFbJWKP7/lVcXuGI/oXfj8LKjCZiJb0PNpBQlc+nS1C7R6ctoBlW 9FhsHDMjIlD4oOWN8UWCXTQDAn92MvOycQutX7JPEeYGrSicuuSAgz/srvdg+w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644697723; a=rsa-sha256; cv=none; b=eiBCj+pPQVFG1Q1MaxOj25BlYPynTyr2cMaE7O2MuJsqkIRkAmVBqkJe0q/Dzf/0nE3iyQ KrgYlsv4rI7FqGlKBgsuBVphzcsbiJd2Ao/AByolUHxsrflTgG/0VIaPUbP8DSHmSNiOpT BVWr2dlv6gA/dh3Y19oi0RkSkcjYmeUOhOdSaXxW9aBNdgfjM31PoDWQXYB8fKDOEmnPC0 ohHh2D7bEPryoWlBOQ5gw7d++JMkxTwENB5xGMFbFZGGoGErWzhMpN+IApx33oI2D5LQE+ KkcHpmHK3BfqHpnrhMNKo23yFJwrDfx0+BnsHB+4mfbmgBLAhp8Fm2Ob5Et0oQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.34 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 1FB262BEC1 X-Spam-Score: -1.34 X-Migadu-Scanner: scn1.migadu.com X-TUID: lNgz9QmMEFiu 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