From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/49823 Path: main.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: regular and adaptive scoring with nnimap Date: Tue, 04 Feb 2003 17:03:13 -0500 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Sender: owner-ding@hpc.uh.edu Message-ID: <4nk7gfd7q6.fsf@lockgroove.bwh.harvard.edu> References: <84u1fwlxj5.fsf@lucy.is.informatik.uni-duisburg.de> <84u1fw7zaw.fsf@lucy.is.informatik.uni-duisburg.de> <4nk7gq8mms.fsf@lockgroove.bwh.harvard.edu> <84wukqtk3c.fsf@lucy.is.informatik.uni-duisburg.de> <4nof5txezm.fsf@lockgroove.bwh.harvard.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1044396166 17153 80.91.224.249 (4 Feb 2003 22:02:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 4 Feb 2003 22:02:46 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18gB9Q-0004SQ-00 for ; Tue, 04 Feb 2003 23:02:44 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18gBAR-0007vF-00; Tue, 04 Feb 2003 16:03:47 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 04 Feb 2003 16:04:44 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id QAA15210 for ; Tue, 4 Feb 2003 16:04:31 -0600 (CST) Original-Received: (qmail 10177 invoked by alias); 4 Feb 2003 22:03:30 -0000 Original-Received: (qmail 10172 invoked from network); 4 Feb 2003 22:03:29 -0000 Original-Received: from clifford.bwh.harvard.edu (134.174.9.41) by 66.230.238.6 with SMTP; 4 Feb 2003 22:03:29 -0000 Original-Received: from lockgroove.bwh.harvard.edu (lockgroove [134.174.9.133]) by clifford.bwh.harvard.edu (8.10.2+Sun/8.11.0) with ESMTP id h14M3Nj11831 for ; Tue, 4 Feb 2003 17:03:23 -0500 (EST) Original-Received: (from tzz@localhost) by lockgroove.bwh.harvard.edu (8.11.6+Sun/8.11.0) id h14M3Dj23732; Tue, 4 Feb 2003 17:03:13 -0500 (EST) Original-To: ding@gnus.org X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Followup-To: ding@gnus.org User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 (sparc-sun-solaris2.8) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:49823 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:49823 How does this look, for retrieving an article and searching a group by any parameter? (defun nnimap-db-get-article-contents (article group &optional server) (let ((data)) (when (numberp article) (with-current-buffer (nnimap-get-server-buffer server) (let ((saved (imap-current-mailbox))) (with-temp-buffer (nnimap-request-article article group server (buffer-name)) (setq data (buffer-string))) (nnimap-possibly-change-group saved server)))) data)) ;; (nnimap-db-get-article-contents 4388 "ding") (defun nnimap-db-get-uids-for-parameter (group parameter subject &optional server) (let ((articles)) (when (and (stringp subject) (stringp parameter) (stringp group)) (with-current-buffer (nnimap-get-server-buffer server) (let ((saved (imap-current-mailbox))) (nnimap-possibly-change-group group server) (setq articles (imap-search (format "HEADER %s \"%s\"" parameter subject))) (nnimap-possibly-change-group saved server)))) articles)) ;; (nnimap-db-get-uids-for-parameter "ding" "Subject" "spam") ;; (nnimap-db-get-uids-for-parameter "ding" "Message-Id" "") I'm assuming two things: 1) (nnimap-possibly-change-group nil) is harmless 2) (nnimap-possibly-change-group nil) returns the current group Are both true? I would use imap exclusively, but nnimap-possibly-change-group and the other functions it offers are too useful :) Also, do I need to do (setq gnus-newsgroup-active (gnus-activate-group group)) before each operation in case the nnimap server is not activated? Thanks Ted