(mm-codepage-setup): New helper function.
[gnus] / lisp / nnslashdot.el
index 97c7d28..2174eac 100644 (file)
@@ -1,5 +1,7 @@
 ;;; nnslashdot.el --- interfacing with Slashdot
-;; Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -18,8 +20,8 @@
 
 ;; 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:
 
              (setq subject (concat "Re: " (substring subject (match-end 0)))))
            (setq subject (mm-url-decode-entities-string subject))
            (search-forward "<BR>")
-           (if (looking-at
-                "by[ \t\n]+<a[^>]+>\\([^<]+\\)</a>[ \t\n]*(\\(<[^>]+>\\)*\\([^<>)]+\\))")
-               (progn
-                 (goto-char (- (match-end 0) 5))
-                 (setq from (concat
-                             (mm-url-decode-entities-string (match-string 1))
-                             " <" (match-string 3) ">")))
-             (setq from "")
-             (when (looking-at "by \\([^<>]*\\) on ")
-               (goto-char (- (match-end 0) 5))
-               (setq from (mm-url-decode-entities-string (match-string 1)))))
-           (search-forward " on ")
+           (cond 
+            ((looking-at
+              "by[ \t\n]+<a[^>]+>\\([^<]+\\)</a>[ \t\n]*(\\(<[^>]+>\\)*\\([^<>)]+\\))")
+             (goto-char (- (match-end 0) 5))
+             (setq from (concat
+                         (mm-url-decode-entities-string (match-string 1))
+                         " <" (match-string 3) ">")))
+            ((looking-at "by[ \t\n]+<a[^>]+>\\([^<(]+\\) (\\([0-9]+\\))</a>")
+             (goto-char (- (match-end 0) 5))
+             (setq from (concat 
+                         (mm-url-decode-entities-string (match-string 1))
+                         " <" (match-string 2) ">")))
+            ((looking-at "by \\([^<>]*\\)[\t\n\r ]+on ")
+             (goto-char (- (match-end 0) 5))
+             (setq from (mm-url-decode-entities-string (match-string 1))))
+            (t
+             (setq from "")))
+           (search-forward "on ")
            (setq date
                  (nnslashdot-date-to-date
                   (buffer-substring (point) (progn (skip-chars-forward "^()<>\n\r") (point)))))
            (when (numberp article)
              (if (= article 1)
                  (progn
-                   (re-search-forward
-                    "Posted by")
+                   (search-forward "Posted by")
                    (search-forward "<BR>")
                    (setq contents
                          (buffer-substring
        (insert-file-contents file)
        (goto-char (point-min))
        (setq nnslashdot-groups (read (current-buffer))))
-      (if (and nnslashdot-groups (< (length (car nnslashdot-groups)) 5))
-         (let ((groups nnslashdot-groups))
-           (while groups
-             (nnslashdot-make-tuple (car groups) 5)
-             (setq groups (cdr groups))))))))
+      (when (and nnslashdot-groups (< (length (car nnslashdot-groups)) 5))
+       (dolist (group nnslashdot-groups)
+         (nnslashdot-make-tuple group 5))))))
 
 (defun nnslashdot-write-groups ()
   (with-temp-file (expand-file-name "groups" nnslashdot-directory)
 
 (provide 'nnslashdot)
 
+;;; arch-tag: aa73df7a-f7e6-4eef-bdea-5ce2f8c691b3
 ;;; nnslashdot.el ends here
-