From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/81937 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.gnus.general Subject: Re: searching by Message-ID after copy/move; speeding things up Date: Thu, 14 Jun 2012 10:10:12 +0200 Message-ID: <877gvamhzv.fsf@zelenka.enovance.com> References: <87395ypkri.fsf@maru.md5i.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1339661453 22290 80.91.229.3 (14 Jun 2012 08:10:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2012 08:10:53 +0000 (UTC) Cc: ding@gnus.org To: Michael Welsh Duggan Original-X-From: ding-owner+M30207@lists.math.uh.edu Thu Jun 14 10:10:52 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sf58i-0002Y9-NL for ding-account@gmane.org; Thu, 14 Jun 2012 10:10:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Sf58Y-00045D-Vh; Thu, 14 Jun 2012 03:10:39 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Sf58X-000450-4K for ding@lists.math.uh.edu; Thu, 14 Jun 2012 03:10:37 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Sf58J-00037c-PV for ding@lists.math.uh.edu; Thu, 14 Jun 2012 03:10:36 -0500 Original-Received: from [212.85.154.174] (helo=mx1.naquadah.org) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Sf58H-0001t1-An for ding@gnus.org; Thu, 14 Jun 2012 10:10:21 +0200 Original-Received: from zelenka.enovance.com (unknown [80.214.8.3]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.naquadah.org (Postfix) with ESMTPSA id 4F8FA5C2F7; Thu, 14 Jun 2012 10:10:14 +0200 (CEST) Mail-Followup-To: Michael Welsh Duggan , ding@gnus.org In-Reply-To: <87395ypkri.fsf@maru.md5i.com> (Michael Welsh Duggan's message of "Thu, 14 Jun 2012 00:42:09 -0400") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) X-Spam-Score: -1.1 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:81937 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On Thu, Jun 14 2012, Michael Welsh Duggan wrote: > The change was quite simple, and most of my time was spent re-learning > how the nnimap library does things in general. I hope that something > like this can make it into mainline Gnus. Attached is an experimental patch. Could you test it and tell me if this resolve your problem? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-recent-argument-to-nnimap-find-article-by-messag.patch Content-Transfer-Encoding: quoted-printable From=20743f0f50fcfb2779f1ba16382cc0fca9b1364585 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 14 Jun 2012 10:09:04 +0200 Subject: [PATCH] Add recent argument to nnimap-find-article-by-message-id Signed-off-by: Julien Danjou =2D-- lisp/ChangeLog | 7 +++++++ lisp/nnimap.el | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 20a586e..9d0f184 100644 =2D-- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-06-14 Julien Danjou + + * nnimap.el (nnimap-find-article-by-message-id): Add docstring and + recent argument. + (nnimap-request-move-article): Use the recent option of + `nnimap-find-article-by-message-id'. + 2012-06-11 Lars Magne Ingebrigtsen =20 * gnus-art.el (gnus-article-read-summary-keys): Protect against the key diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 5bdf226..0bd45de 100644 =2D-- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -867,7 +867,7 @@ textual parts.") (cons internal-move-group (or (nnimap-find-uid-response "COPYUID" (cadr result)) (nnimap-find-article-by-message-id =2D internal-move-group message-id))))) + internal-move-group message-id t))))) ;; Move the article to a different method. (let ((result (eval accept-form))) (when result @@ -969,7 +969,10 @@ textual parts.") (cdr (assoc "SEARCH" (cdr result)))))))))) =20 =20 =2D(defun nnimap-find-article-by-message-id (group message-id) +(defun nnimap-find-article-by-message-id (group message-id &optional recen= t) + "Search for message with MESSAGE-ID in GROUP. +RECENT can be used to look only in message having the \Resent +flag set, fastening the search.." (with-current-buffer (nnimap-buffer) (erase-buffer) (unless (equal group (nnimap-group nnimap-object)) @@ -977,7 +980,9 @@ textual parts.") (setf (nnimap-examined nnimap-object) group) (nnimap-send-command "EXAMINE %S" (utf7-encode group t))) (let ((sequence =2D (nnimap-send-command "UID SEARCH HEADER Message-Id %S" message-id)) + (nnimap-send-command "UID SEARCH HEADER Message-Id %S%s" + message-id + (if recent " RECENT" ""))) article result) (setq result (nnimap-wait-for-response sequence)) (when (and result =2D-=20 1.7.10 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 Julien --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJP2ZxkAAoJEGEbqVCLeKXCXdwQAJWkE1jKKhzwCkR3eXdyAlOg +cER9dGu4yz7JzkI8db22EdpItMxK4A5JW2c9QAMf33yl3LCquEIJxjS5TzhuzTT TYsP3ofrxwy9vkrVdQYViJaC8evb5KPKHkxqbE5162aPa7vrmPyniLdzHY8CrcSs qNRUXUkq/jOk9bp6V4vX/NNwwWLcsrAp0selFoRhuLR+1wEmbMJRjxPz1xzqUNiK 9Z1sKlelVyfukjl4kJq4reKvzjC17WU794S0K14rR1UvmKil43zjWHtUlLawi2bn w6P/DLVuspk5uv5/vs5r1MFNaRiY+rlQhlVo8C+DayGLSevvRwXOJfIY0a42VKrm f5Fet60Gi7okx/7t5n5RyanGBHcdJsF+4Vc7CoZ2NIWXVf8KQOATilaled2hqXs5 SxwTPAWozSI0uaZO1AeN6eROp07466dyYyRKSCIjl1DbVcAThnlKfMyBQ1Xyfrk6 qIo1Bo3H+F/kqGPzEmT1ObK+o2KnmisIvFf44vup85+LX+Yjrx4lBdTV9q1Ut7O+ wdc8RqQyO7YITuTmnQWEsqCNDrZgI34e4R7MV09GBJ/FZGWuwo0JbX2LR6dYJUkU ivCNwN8/WxW+ZQaCG9Zk7nAN/v6Dbt1aZ5j6+FWfcHvCqvlbFmAUII/xDeZZnBLs lHWLG92vYFgIghWeYb6h =2CPH -----END PGP SIGNATURE----- --==-=-=--