Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A4132431FAF for ; Wed, 9 Oct 2013 07:11:56 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EtfEEY9Jcn2d for ; Wed, 9 Oct 2013 07:11:50 -0700 (PDT) Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id 51196431FAE for ; Wed, 9 Oct 2013 07:11:50 -0700 (PDT) X-AuditID: 12074422-b7f5a8e000000a34-fc-525564238d71 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id DF.FD.02612.32465525; Wed, 9 Oct 2013 10:11:47 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id r99EBkDt005590; Wed, 9 Oct 2013 10:11:47 -0400 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r99EBj4o020422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 9 Oct 2013 10:11:46 -0400 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) (envelope-from ) id 1VTuUK-00050C-Rj; Wed, 09 Oct 2013 10:11:44 -0400 Date: Wed, 9 Oct 2013 10:11:44 -0400 From: Austin Clements To: Mark Walters Subject: Re: [PATCH 07/11] emacs: Use notmuch tag --batch for large tag queries Message-ID: <20131009141144.GO21611@mit.edu> References: <1381185201-25197-1-git-send-email-amdragon@mit.edu> <1381185201-25197-8-git-send-email-amdragon@mit.edu> <87vc18rzn3.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87vc18rzn3.fsf@qmul.ac.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IR4hTV1lVOCQ0y2L9dxmL1XB6L6zdnMjsw eeycdZfd49mqW8wBTFFcNimpOZllqUX6dglcGU8PzWUtOM5XMfPyZOYGxu3cXYycHBICJhJT V25ggbDFJC7cW8/WxcjFISSwj1Gi6ekDZghnA6PE2zdfmSCcU0wSvR0ToMqWMEq8eLiGGaSf RUBFYv2Xj6wgNpuAhsS2/csZQWwRAR2J24cWsIPYzALSEt9+NzOB2MICgRJXN7eD1fMC1Zy6 8JgRYuhURonvT96zQCQEJU7OfMIC0awlcePfS6BmDrBBy/9xgIQ5gXatW3YfbKYo0A1TTm5j m8AoNAtJ9ywk3bMQuhcwMq9ilE3JrdLNTczMKU5N1i1OTszLSy3SNdXLzSzRS00p3cQICmx2 F6UdjD8PKh1iFOBgVOLhfcAfEiTEmlhWXJl7iFGSg0lJlHd7TGiQEF9SfkplRmJxRnxRaU5q 8SFGCQ5mJRFe42igHG9KYmVValE+TEqag0VJnPcWh32QkEB6YklqdmpqQWoRTFaGg0NJgvdD ElCjYFFqempFWmZOCUKaiYMTZDgP0PBTIDW8xQWJucWZ6RD5U4yKUuK8DIlACQGQREZpHlwv LPG8YhQHekWYtxeknQeYtOC6XwENZgIavP17CMjgkkSElFQDo5yCmKhKSdhJr3+P6nfqf0+9 8OjWXiWBsOaiG+bM//z2zghW6HnuZG+88vzJ7qMdW3sTF6zd3VOYuKUnsHTppeSrnzoOsofk T5iWpB95OH7b6vrOVbdk3jUf3767mi9N+OvLOVlCHPUKLxhXT5jpq/9+0tfjMWsiHfqv3LJx l7q4Z1t3QaBplBJLcUaioRZzUXEiAFXg7agXAwAA Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Wed, 09 Oct 2013 14:11:56 -0000 Quoth Mark Walters on Oct 08 at 8:27 am: > On Mon, 07 Oct 2013, Austin Clements wrote: > > (Unfortunately, it's difficult to first demonstrate this problem with > > a known-broken test because modern Linux kernels have argument length > > limits in the megabytes, which makes Emacs really slow!) > > --- > > emacs/notmuch-lib.el | 8 ++++++++ > > emacs/notmuch-tag.el | 12 ++++++++++-- > > test/emacs | 8 ++++++++ > > 3 files changed, 26 insertions(+), 2 deletions(-) > > > > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el > > index 22156f1..348112b 100644 > > --- a/emacs/notmuch-lib.el > > +++ b/emacs/notmuch-lib.el > > @@ -261,6 +261,14 @@ user-friendly queries." > > "Return a query that matches the message with id ID." > > (concat "id:" (notmuch-escape-boolean-term id))) > > > > +(defun notmuch-hex-encode (str) > > + "Hex-encode STR (e.g., as used by batch tagging). > > + > > +This replaces spaces, percents, and double quotes in STR with > > +%NN where NN is the hexadecimal value of the character." > > + (replace-regexp-in-string > > + "[ %\"]" (lambda (match) (format "%%%02x" (aref match 0))) str)) > > + > > ;; > > > > (defun notmuch-common-do-stash (text) > > diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el > > index 064cfa8..a4eec14 100644 > > --- a/emacs/notmuch-tag.el > > +++ b/emacs/notmuch-tag.el > > @@ -242,6 +242,8 @@ from TAGS if present." > > (error "Changed tag must be of the form `+this_tag' or `-that_tag'"))))) > > (sort result-tags 'string<))) > > > > +(defconst notmuch-tag-argument-limit 1000) > > + > > Another triviality: I think this should have a doc string saying use > batch tag if the query is longer than this. Done. > The other patches in the series up to this point LGTM. > > Mark