;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
:type '(regexp)
:group 'nnir)
-;; Swish-E. Next three variables Copyright (C) 2000 Christoph Conrad
-;; <christoph.conrad@gmx.de>.
+;; Swish-E.
;; URL: http://sunsite.berkeley.edu/SWISH-E/
;; New version: http://www.boe.es/swish-e
+;; Variables `nnir-swish-e-index-file', `nnir-swish-e-program' and
+;; `nnir-swish-e-additional-switches'
+;; Copyright (C) 2000 Christoph Conrad <christoph.conrad@gmx.de>.
+(make-obsolete-variable 'nnir-swish-e-index-file
+ 'nnir-swish-e-index-files)
(defcustom nnir-swish-e-index-file
(expand-file-name "~/Mail/index.swish-e")
"*Index file for swish-e.
-This could be a server parameter."
+This could be a server parameter.
+It is never consulted once `nnir-swish-e-index-files', which should be
+used instead, has been customized."
:type '(file)
:group 'nnir)
+(defcustom nnir-swish-e-index-files
+ (list nnir-swish-e-index-file)
+ "*List of index files for swish-e.
+This could be a server parameter."
+ :type '(repeat (file))
+ :group 'nnir)
+
(defcustom nnir-swish-e-program "swish-e"
"*Name of swish-e search executable.
This cannot be a server parameter."
(deffoo nnir-retrieve-headers (articles &optional group server fetch-old)
(save-excursion
(let ((artlist (copy-sequence articles))
- (idx 1)
(art nil)
(artitem nil)
(artgroup nil) (artno nil)
;; NOV data and prepend to `novdata'
(set-buffer nntp-server-buffer)
(nnir-possibly-change-server server)
- (case (setq foo (gnus-retrieve-headers (list artno) artfullgroup nil))
- (nov
- (goto-char (point-min))
- (setq novitem (nnheader-parse-nov))
- (unless novitem
- (pop-to-buffer nntp-server-buffer)
- (error
- "nnheader-parse-nov returned nil for article %s in group %s"
- artno artfullgroup)))
- (headers
- (goto-char (point-min))
- (setq novitem (nnheader-parse-head))
- (unless novitem
- (pop-to-buffer nntp-server-buffer)
- (error
- "nnheader-parse-head returned nil for article %s in group %s"
- artno artfullgroup)))
- (t (nnheader-report 'nnir "Don't support header type %s." foo)))
+ (let ((gnus-override-method
+ (gnus-server-to-method server)))
+ (case (setq foo (gnus-retrieve-headers (list artno) artfullgroup nil))
+ (nov
+ (goto-char (point-min))
+ (setq novitem (nnheader-parse-nov))
+ (unless novitem
+ (pop-to-buffer nntp-server-buffer)
+ (error
+ "nnheader-parse-nov returned nil for article %s in group %s"
+ artno artfullgroup)))
+ (headers
+ (goto-char (point-min))
+ (setq novitem (nnheader-parse-head))
+ (unless novitem
+ (pop-to-buffer nntp-server-buffer)
+ (error
+ "nnheader-parse-head returned nil for article %s in group %s"
+ artno artfullgroup)))
+ (t (nnheader-report 'nnir "Don't support header type %s." foo))))
;; replace article number in original group with article number
;; in nnir group
- (mail-header-set-number novitem idx)
+ (mail-header-set-number novitem art)
(mail-header-set-from novitem
(mail-header-from novitem))
(mail-header-set-subject
(mail-header-subject novitem)))
;;-(mail-header-set-extra novitem nil)
(push novitem novdata)
- (setq artlist (cdr artlist))
- (setq idx (1+ idx)))
+ (setq artlist (cdr artlist)))
(setq novdata (nreverse novdata))
(set-buffer nntp-server-buffer) (erase-buffer)
(mapcar 'nnheader-insert-nov novdata)
(deffoo nnir-request-article (article
&optional group server to-buffer)
- (save-excursion
- (let* ((artitem (nnir-artlist-article nnir-artlist
- article))
- (artfullgroup (nnir-artitem-group artitem))
- (artno (nnir-artitem-number artitem))
- ;; Bug?
- ;; Why must we bind nntp-server-buffer here? It won't
- ;; work if `buf' is used, say. (Of course, the set-buffer
- ;; line below must then be updated, too.)
- (nntp-server-buffer (or to-buffer nntp-server-buffer)))
- (set-buffer nntp-server-buffer)
- (erase-buffer)
- (message "Requesting article %d from group %s"
- artno artfullgroup)
- (gnus-request-article artno artfullgroup nntp-server-buffer)
- (cons artfullgroup artno))))
+ (if (stringp article)
+ (nnheader-report
+ 'nnir
+ "nnir-retrieve-headers doesn't grok message ids: %s"
+ article)
+ (save-excursion
+ (let* ((artitem (nnir-artlist-article nnir-artlist
+ article))
+ (artfullgroup (nnir-artitem-group artitem))
+ (artno (nnir-artitem-number artitem))
+ ;; Bug?
+ ;; Why must we bind nntp-server-buffer here? It won't
+ ;; work if `buf' is used, say. (Of course, the set-buffer
+ ;; line below must then be updated, too.)
+ (nntp-server-buffer (or to-buffer nntp-server-buffer)))
+ (set-buffer nntp-server-buffer)
+ (erase-buffer)
+ (message "Requesting article %d from group %s"
+ artno artfullgroup)
+ (gnus-request-article artno artfullgroup nntp-server-buffer)
+ (cons artfullgroup artno)))))
(nnoo-define-skeleton nnir)
dirnam (file-name-directory (match-string 2)))
;; don't match directories
- (when (string-match "^[0-9]+$" artno)
+ (when (string-match "^[0-9]+\\(\\.[a-z0-9]+\\)?$" artno)
+ ;; nnml-use-compressed-files might be any string, but probably this
+ ;; is sufficient. Note that we can't only use the value of
+ ;; nnml-use-compressed-files because old articles might have been
+ ;; saved with a different value.
(when (not (null dirnam))
;; maybe limit results to matching groups.
(erase-buffer)
(message "Doing swish-e query %s..." query)
- (let* ((index-file
+ (let* ((index-files
(or (nnir-read-server-parm
- 'nnir-swish-e-index-file server)
- (error "Missing parameter `nnir-swish-e-index-file'")))
+ 'nnir-swish-e-index-files server)
+ (error "Missing parameter `nnir-swish-e-index-files'")))
(additional-switches
(nnir-read-server-parm
'nnir-swish-e-additional-switches server))
nil ; input from /dev/null
t ; output
nil ; don't redisplay
- "-f" ,index-file
+ "-f" ,@index-files
,@additional-switches
"-w"
,qstring ; the query, in swish-e format
(cond ((and method (assq key (cddr method)))
(nth 1 (assq key (cddr method))))
((and nnir-mail-backend
- (gnus-method-equal method nnir-mail-backend))
+ (gnus-server-equal method nnir-mail-backend))
(symbol-value key))
((null nnir-mail-backend)
(symbol-value key))
(defun nnir-artlist-artitem-rsv (artlist n)
"Returns from ARTLIST the Retrieval Status Value of the Nth artitem
-(counting from 1)."
+\(counting from 1)."
(nnir-artitem-rsv (nnir-artlist-article artlist n)))
;; unused?