]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/nnir.el
Merge changes made in Gnus trunk.
[gnu-emacs] / lisp / gnus / nnir.el
index db8b3971787b60e2353754ca44716437f47c87a4..7a5380c52bbdcb4c4f7e0831333392fb5e2592dc 100644 (file)
@@ -792,40 +792,30 @@ and show thread that contains this article."
          (if nnir-get-article-nov-override-function
              (setq novitem (funcall nnir-get-article-nov-override-function
                                     artitem))
-         ;; else, set novitem through nnheader-parse-nov/nnheader-parse-head
+           ;; else, set novitem through nnheader-parse-nov/nnheader-parse-head
            (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)))
+              (setq novitem (nnheader-parse-nov)))
              (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)))
+              (setq novitem (nnheader-parse-head)))
              (t (error "Unknown header type %s while requesting article %s of group %s"
                        foo artno artfullgroup)))))
        ;; replace article number in original group with article number
         ;; in nnir group
-        (mail-header-set-number novitem art)
-        (mail-header-set-from novitem
-                              (mail-header-from novitem))
-        (mail-header-set-subject
-         novitem
-         (format "[%d: %s/%d] %s"
-                 artrsv artgroup artno
-                 (mail-header-subject novitem)))
-        ;;-(mail-header-set-extra novitem nil)
-        (push novitem novdata)
-        (setq artlist (cdr artlist)))
+       (when novitem
+         (mail-header-set-number novitem art)
+         (mail-header-set-from novitem
+                               (mail-header-from novitem))
+         (mail-header-set-subject
+          novitem
+          (format "[%d: %s/%d] %s"
+                  artrsv artgroup artno
+                  (mail-header-subject novitem)))
+         (push novitem novdata)
+         (setq artlist (cdr artlist))))
       (setq novdata (nreverse novdata))
       (set-buffer nntp-server-buffer) (erase-buffer)
       (mapc 'nnheader-insert-nov novdata)
@@ -881,7 +871,9 @@ ready to be added to the list of search results."
   (when (file-readable-p (concat prefix dirnam article))
     ;; remove trailing slash and, for nnmaildir, cur/new/tmp
     (setq dirnam
-         (substring dirnam 0 (if (string= server "nnmaildir:") -5 -1)))
+         (substring dirnam 0
+                    (if (string= (gnus-group-server server) "nnmaildir")
+                        -5 -1)))
 
     ;; Set group to dirnam without any leading dots or slashes,
     ;; and with all subsequent slashes replaced by dots
@@ -890,7 +882,7 @@ ready to be added to the list of search results."
                  "[/\\]" "." t)))
 
     (vector (nnir-group-full-name group server)
-           (if (string= server "nnmaildir:")
+           (if (string= (gnus-group-server server) "nnmaildir")
                (nnmaildir-base-name-to-article-number
                 (substring article 0 (string-match ":" article))
                 group nil)
@@ -983,7 +975,7 @@ details on the language and supported extensions"
              (message "Searching %s..." group)
              (let ((arts 0)
                    (result
-                    (nnimap-command "UID SEARCH  %s"
+                    (nnimap-command "UID SEARCH %s"
                                     (if (string= criteria "")
                                         qstring
                                       (nnir-imap-make-query criteria qstring)
@@ -1200,7 +1192,7 @@ Windows NT 4.0."
           ;; 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.
-          (article-pattern (if (string= server "nnmaildir:")
+          (article-pattern (if (string= (gnus-group-server server) "nnmaildir")
                                ":[0-9]+"
                              "^[0-9]+\\(\\.[a-z0-9]+\\)?$"))
            score artno dirnam filenam)
@@ -1450,7 +1442,7 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
   (when group
     (error "The Namazu backend cannot search specific groups"))
   (save-excursion
-    (let ((article-pattern (if (string= server "nnmaildir:")
+    (let ((article-pattern (if (string= (gnus-group-server server) "nnmaildir")
                               ":[0-9]+"
                             "^[0-9]+$"))
           artlist
@@ -1588,7 +1580,7 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
   (let ((sym (car parmspec))
         (prompt (cdr parmspec)))
     (if (listp prompt)
-       (let* ((result (apply 'completing-read prompt))
+       (let* ((result (gnus-completing-read prompt nil))
               (mapping (or (assoc result nnir-imap-search-arguments)
                            (assoc nil nnir-imap-search-arguments))))
          (cons sym (format (cdr mapping) result)))