Synch to No Gnus 200401141432.
[elisp/gnus.git-] / lisp / nnrss.el
index 6e94f09..35739a6 100644 (file)
@@ -323,7 +323,6 @@ ARTICLE is the article number of the current headline.")
     (when (file-exists-p file)
       (with-temp-buffer
        (let ((coding-system-for-read 'binary)
-             (input-coding-system 'binary)
              emacs-lisp-mode-hook)
          (insert-file-contents file)
          (emacs-lisp-mode)
@@ -340,7 +339,6 @@ ARTICLE is the article number of the current headline.")
                        server ".el"))
               nnrss-directory)))
     (let ((coding-system-for-write 'binary)
-         (output-coding-system 'binary)
          print-level print-length)
       (with-temp-file file
        (insert "(setq nnrss-group-alist '"
@@ -366,7 +364,6 @@ ARTICLE is the article number of the current headline.")
     (when (file-exists-p file)
       (with-temp-buffer
        (let ((coding-system-for-read 'binary)
-             (input-coding-system 'binary)
              emacs-lisp-mode-hook)
          (insert-file-contents file)
          (emacs-lisp-mode)
@@ -389,7 +386,6 @@ ARTICLE is the article number of the current headline.")
                        server ".el"))
               nnrss-directory)))
     (let ((coding-system-for-write 'binary)
-         (output-coding-system 'binary)
          print-level print-length)
       (with-temp-file file
        (insert "(setq nnrss-group-data '"
@@ -428,7 +424,7 @@ ARTICLE is the article number of the current headline.")
                                        (nnrss-translate-file-chars
                                         (concat group ".xml"))
                                        nnrss-directory))))
-       (nnrss-fetch file t)
+       (setq xml (nnrss-fetch file t))
       (setq url (or (nth 2 (assoc group nnrss-server-data))
                    (second (assoc group nnrss-group-alist))))
       (unless url
@@ -461,7 +457,8 @@ ARTICLE is the article number of the current headline.")
        (setq extra (or (nnrss-node-text content-ns 'encoded item)
                        (nnrss-node-text rss-ns 'description item)))
        (setq author (or (nnrss-node-text rss-ns 'author item)
-                        (nnrss-node-text dc-ns 'creator item)))
+                        (nnrss-node-text dc-ns 'creator item)
+                        (nnrss-node-text dc-ns 'contributor item)))
        (setq date (or (nnrss-node-text dc-ns 'date item)
                       (nnrss-node-text rss-ns 'pubDate item)
                       (message-make-date)))
@@ -688,48 +685,50 @@ whether they are `offsite' or `onsite'."
 
 (defun nnrss-find-rss-via-syndic8 (url)
   "query syndic8 for the rss feeds it has for the url."
-  (if (locate-library "xml-rpc")
-      (progn (require 'xml-rpc)
-            (let ((feedid (xml-rpc-method-call
-                           "http://www.syndic8.com/xmlrpc.php"
-                           'syndic8.FindSites
-                           url)))
-              (if feedid
-                  (let* ((feedinfo (xml-rpc-method-call 
-                                    "http://www.syndic8.com/xmlrpc.php"
-                                    'syndic8.GetFeedInfo
-                                    feedid))
-                         (urllist
-                          (delq nil 
-                                (mapcar
-                                 (lambda (listinfo)
-                                   (if (string-equal 
-                                        (cdr (assoc "status" listinfo))
-                                        "Syndicated")
-                                       (cons
-                                        (cdr (assoc "sitename" listinfo))
-                                        (list
-                                         (cons 'title
-                                               (cdr (assoc 
-                                                     "sitename" listinfo)))
-                                         (cons 'href
-                                               (cdr (assoc
-                                                     "dataurl" listinfo)))))))
-                                 feedinfo))))
-                    (if (> (length urllist) 1)
-                        (let ((completion-ignore-case t)
-                              (selection 
-                               (mapcar (lambda (listinfo)
-                                         (cons (cdr (assoc "sitename" listinfo)) 
-                                               (string-to-int 
-                                                (cdr (assoc "feedid" listinfo)))))
-                                       feedinfo)))
-                          (cdr (assoc 
-                                (completing-read
-                                 "Multiple feeds found.  Select one: "
-                                 selection nil t) urllist)))
-                      (cdar urllist))))))
-    (error (message "XML-RPC is not available... not checking Syndic8."))))
+  (if (not (locate-library "xml-rpc"))
+      (progn
+       (message "XML-RPC is not available... not checking Syndic8.")
+       nil)
+    (require 'xml-rpc)
+    (let ((feedid (xml-rpc-method-call
+                  "http://www.syndic8.com/xmlrpc.php"
+                  'syndic8.FindSites
+                  url)))
+      (when feedid
+       (let* ((feedinfo (xml-rpc-method-call 
+                         "http://www.syndic8.com/xmlrpc.php"
+                         'syndic8.GetFeedInfo
+                         feedid))
+              (urllist
+               (delq nil 
+                     (mapcar
+                      (lambda (listinfo)
+                        (if (string-equal 
+                             (cdr (assoc "status" listinfo))
+                             "Syndicated")
+                            (cons
+                             (cdr (assoc "sitename" listinfo))
+                             (list
+                              (cons 'title
+                                    (cdr (assoc 
+                                          "sitename" listinfo)))
+                              (cons 'href
+                                    (cdr (assoc
+                                          "dataurl" listinfo)))))))
+                      feedinfo))))
+         (if (not (> (length urllist) 1))
+             (cdar urllist)
+           (let ((completion-ignore-case t)
+                 (selection 
+                  (mapcar (lambda (listinfo)
+                            (cons (cdr (assoc "sitename" listinfo)) 
+                                  (string-to-int 
+                                   (cdr (assoc "feedid" listinfo)))))
+                          feedinfo)))
+             (cdr (assoc 
+                   (completing-read
+                    "Multiple feeds found.  Select one: "
+                    selection nil t) urllist)))))))))
 
 (defun nnrss-rss-p (data)
   "Test if data is an RSS feed.  Simply ensures that the first