comparison lisp/gnus/nnir.el @ 108439:c3622fa53abe

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 26 Mar 2010 15:03:20 +0000
parents 0fe940324254
children c168d4537385
comparison
equal deleted inserted replaced
108438:2485b1fb98d3 108439:c3622fa53abe
355 (nil . "HEADER \"%s\"")) 355 (nil . "HEADER \"%s\""))
356 "Mapping from user readable strings to IMAP search items for use in nnir") 356 "Mapping from user readable strings to IMAP search items for use in nnir")
357 357
358 (defvar nnir-imap-search-argument-history () 358 (defvar nnir-imap-search-argument-history ()
359 "The history for querying search options in nnir") 359 "The history for querying search options in nnir")
360
361 (defvar nnir-get-article-nov-override-function nil
362 "If non-nil, a function that will be passed each search result. This
363 should return a message's headers in NOV format.
364
365 If this variable is nil, or if the provided function returns nil for a search
366 result, `gnus-retrieve-headers' will be called instead.")
367
360 368
361 ;;; Developer Extension Variable: 369 ;;; Developer Extension Variable:
362 370
363 (defvar nnir-engines 371 (defvar nnir-engines
364 `((wais nnir-run-waissearch 372 `((wais nnir-run-waissearch
777 ;; NOV data and prepend to `novdata' 785 ;; NOV data and prepend to `novdata'
778 (set-buffer nntp-server-buffer) 786 (set-buffer nntp-server-buffer)
779 (nnir-possibly-change-server server) 787 (nnir-possibly-change-server server)
780 (let ((gnus-override-method 788 (let ((gnus-override-method
781 (gnus-server-to-method server))) 789 (gnus-server-to-method server)))
782 (case (setq foo (gnus-retrieve-headers (list artno) artfullgroup nil)) 790 ;; if nnir-get-article-nov-override-function is set, use it
783 (nov 791 (if nnir-get-article-nov-override-function
784 (goto-char (point-min)) 792 (setq novitem (funcall nnir-get-article-nov-override-function
785 (setq novitem (nnheader-parse-nov)) 793 artitem))
786 (unless novitem 794 ;; else, set novitem through nnheader-parse-nov/nnheader-parse-head
787 (pop-to-buffer nntp-server-buffer) 795 (case (setq foo (gnus-retrieve-headers (list artno)
788 (error 796 artfullgroup nil))
789 "nnheader-parse-nov returned nil for article %s in group %s" 797 (nov
790 artno artfullgroup))) 798 (goto-char (point-min))
791 (headers 799 (setq novitem (nnheader-parse-nov))
792 (goto-char (point-min)) 800 (unless novitem
793 (setq novitem (nnheader-parse-head)) 801 (pop-to-buffer nntp-server-buffer)
794 (unless novitem 802 (error
795 (pop-to-buffer nntp-server-buffer) 803 "nnheader-parse-nov returned nil for article %s in group %s"
796 (error 804 artno artfullgroup)))
797 "nnheader-parse-head returned nil for article %s in group %s" 805 (headers
798 artno artfullgroup))) 806 (goto-char (point-min))
799 (t (error "Unknown header type %s while requesting article %s of group %s" 807 (setq novitem (nnheader-parse-head))
800 foo artno artfullgroup)))) 808 (unless novitem
809 (pop-to-buffer nntp-server-buffer)
810 (error
811 "nnheader-parse-head returned nil for article %s in group %s"
812 artno artfullgroup)))
813 (t (error "Unknown header type %s while requesting article %s of group %s"
814 foo artno artfullgroup)))))
801 ;; replace article number in original group with article number 815 ;; replace article number in original group with article number
802 ;; in nnir group 816 ;; in nnir group
803 (mail-header-set-number novitem art) 817 (mail-header-set-number novitem art)
804 (mail-header-set-from novitem 818 (mail-header-set-from novitem
805 (mail-header-from novitem)) 819 (mail-header-from novitem))