From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: Re: Fixing slowness of following Gnus links to IMAP articles Date: Sun, 01 Aug 2010 10:38:07 +0200 Message-ID: <877hkasp74.wl%dmaus@ictsoc.de> References: <87r5jrcx9g.fsf@mundaneum.com> <87vd8gcu6k.fsf@mundaneum.com> <87oce7j26i.fsf@thinkpad.tsdh.de> <87fwzjfyf8.fsf@mundaneum.com> <878w5bkxx7.fsf@mundaneum.com> <87hbjyzicz.fsf@thinkpad.tsdh.de> <13292.1279382554@gamaville.dokosmarshall.org> <87zkxpanh1.fsf@mundaneum.com> <23154.1279399784@gamaville.dokosmarshall.org> <87zkxpg5cg.fsf@mundaneum.com> <87wrstn4a9.fsf@mundaneum.com> <87fwzf51t1.fsf@thinkpad.tsdh.de> <87d3ujbrwt.wl%dmaus@ictsoc.de> <87wrsrmcnf.fsf@mundaneum.com> <87lj96k6xn.wl%dmaus@ictsoc.de> <87wrsoy5b2.fsf@mundaneum.com> <87aapdzalm.fsf_-_@thinkpad.tsdh.de> <874ofkoekr.wl%dmaus@ictsoc.de> <11714.1280265482@alphaville.usa.hp.com> <87bp9s14nn.fsf@thinkpad.tsdh.de> <87zkxaeo8g.wl%dmaus@ictsoc.de> <87lj8uqi14.fsf@thinkpad.tsdh.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="===============0650996888==" Return-path: Received: from [140.186.70.92] (port=49922 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfbWX-0002Oc-MG for emacs-orgmode@gnu.org; Sun, 01 Aug 2010 12:36:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfU3s-000311-Dw for emacs-orgmode@gnu.org; Sun, 01 Aug 2010 04:38:25 -0400 Received: from mysql1.xlhost.de ([213.202.242.106]:34035) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfU3s-00030m-5J for emacs-orgmode@gnu.org; Sun, 01 Aug 2010 04:38:24 -0400 In-Reply-To: <87lj8uqi14.fsf@thinkpad.tsdh.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tassilo Horn Cc: emacs-orgmode@gnu.org --===============0650996888== Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sun_Aug__1_10:38:06_2010-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --pgp-sign-Multipart_Sun_Aug__1_10:38:06_2010-1 Content-Type: text/plain; charset=US-ASCII Tassilo Horn wrote: >> Second it would return a cons (min-UID . max-UID). That wouldn't help >> us, would it? >What an appropriately named function that is. ;-) No, that wouldn't >help. But its code could be stolen to write and own function to insert >the right NOV file in a temp buffer, to search for the message-id. >Something like that: Well, using `nnimap-retrieve-headers-from-file' would work because it loads the cache into `nntp-server-buffer'. But it turned out that my problem with the garbled cache is a bug in this function: It doesn't erase the buffer before inserting the cache file and the buffer is not empty (bug report filed). So we need our own function. A slight modification of yours: --8<---------------cut here---------------start------------->8--- (defun org-gnus-nnimap-get-article-number (group server message-id) (with-temp-buffer (let ((nov (nnimap-group-overview-filename group server))) (when (file-exists-p nov) (mm-insert-file-contents nov) (set-buffer-modified-p nil) (goto-char (point-min)) (catch 'found (while (search-forward message-id nil t) (let ((hdr (split-string (thing-at-point 'line) "\t"))) (if (string= (nth 4 hdr) message-id) (throw 'found (number-to-string (nth 0 hdr))))))))))) --8<---------------cut here---------------start------------->8--- - the message-id might also appear in a in-reply-to oder references field - use a temp buffer to avoid possible confusion for Gnus (e.g. content of nntp-server-buffer changed outside Gnus) Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Sun_Aug__1_10:38:06_2010-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAkxVMm4ACgkQma24O1pEeOaZyQEAhufElf8ap4VCIswgTaGfMXYP gJF/B8jJj6FSBNDUSU8A/R9fFK95hv8hARjAK9/ky/TdAGx0/D6aXziWYbMdHRq8 =ge93 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sun_Aug__1_10:38:06_2010-1-- --===============0650996888== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0650996888==--