From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: Re: Fixing slowness of following Gnus links to IMAP articles Date: Thu, 29 Jul 2010 20:06:47 +0200 Message-ID: <87lj8uqi14.fsf@thinkpad.tsdh.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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=46408 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeXVe-0001R1-Bz for emacs-orgmode@gnu.org; Thu, 29 Jul 2010 14:07:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OeXVY-0003Ih-Px for emacs-orgmode@gnu.org; Thu, 29 Jul 2010 14:07:10 -0400 Received: from lo.gmane.org ([80.91.229.12]:34313) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeXVY-0003IW-FE for emacs-orgmode@gnu.org; Thu, 29 Jul 2010 14:07:04 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OeXVU-0002Hg-Nf for emacs-orgmode@gnu.org; Thu, 29 Jul 2010 20:07:00 +0200 Received: from p54af1814.dip0.t-ipconnect.de ([84.175.24.20]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Jul 2010 20:07:00 +0200 Received: from tassilo by p54af1814.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Jul 2010 20:07:00 +0200 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: emacs-orgmode@gnu.org David Maus writes: Hi David, > Finally I got a novcache: Congratulations! ;-) > ,----[ gnus.el ] > | ;;; Experimental Gnus setup > | > | (setq gnus-select-method '(nntp "news.gmane.org")) > | (setq gnus-secondary-select-methods > | '((nnimap "localhost" > | (nnimap-address "localhost") > | (nnimap-server-port 993) > | (nnimap-stream ssl)))) > | > | (setq nnimap-nov-is-evil nil) > | (setq gnus-cache-enter-articles '(ticked dormant unread read)) > | > | (setq org-gnus-nnimap-query-article-no-from-file t) > `---- > > Now the strange thing is that the novcache file in ~/News/overview is > 100% identical to .overview in ~/News/agent Two are better than one! (I have no idea why.) > ,---- > | dmaus@t41 ~/News % md5sum overview/nnimap/localhost/INBOX/1280089306/novcache agent/nnimap/localhost/INBOX/.overview > | b4a78e25a064f0c260f76080a00991cd overview/nnimap/localhost/INBOX/1280089306/novcache > | b4a78e25a064f0c260f76080a00991cd agent/nnimap/localhost/INBOX/.overview > | dmaus@t41 ~/News % > `---- > > Anyway: `nnimap-retrieve-headers-from-file' does not work as expected. > First, it requires the group parameter without backend and server > prefix (e.g. "INBOX" instead of "nnimap+localhost:INBOX". I've expected that. > 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: --8<---------------cut here---------------start------------->8--- (defun org-gnus-nnimap-get-article-number (group server message-id) (with-current-buffer nntp-server-buffer (let ((nov (nnimap-group-overview-filename group server))) (when (file-exists-p nov) (mm-insert-file-contents nov) (set-buffer-modified-p nil) (when (search-forward message-id nil t) (goto-char (line-beginning-position)) (read (current-buffer))))))) --8<---------------cut here---------------end--------------->8--- That function is totally untested, but might do what it should. > Third and amazingly my novcache seems to be corrupt right after > creation: `nnimap-retrieve-headers-from-file' does not get the maximum > UID but reads "INBOX" (?!) -- A string that looks kind of a header > information for nov -- and not "18753" what is the highest UID in the > mailbox. > > Last line of the cache: > (it's a local copy of wanderlust general newsgroup accessed via IMAP) > > ,---- > | 18753 Re: checking imap folder unplugged Yoichi NAKAYAMA Sun, 13 Oct 2002 10:19:13 +0900 <87ptvqcd9p.wl@eken.phys.nagoya-u.ac.jp> 4424 13 Xref: t41.ictsoc.de INBOX:18753 Newsgroups: gmane.mail.wanderlust.general.japanese > `---- Really strange. Maybe the corruption comes from replacing TABs by spaces using some home-brewn auto-replace-all-tabs-with-spaces function? Bye, Tassilo