X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnslashdot.el;h=2174eac67456d09c94ea3c73c0f944abba982ffc;hb=c40056695d7dcc4e7c71707009bc077a18a3344d;hp=97c7d28456d15716c89055075d95ece506d696de;hpb=6a372e11b86a922937ab70c37b1f6fb61f6df076;p=gnus diff --git a/lisp/nnslashdot.el b/lisp/nnslashdot.el index 97c7d2845..2174eac67 100644 --- a/lisp/nnslashdot.el +++ b/lisp/nnslashdot.el @@ -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 ;; 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: @@ -152,18 +154,24 @@ (setq subject (concat "Re: " (substring subject (match-end 0))))) (setq subject (mm-url-decode-entities-string subject)) (search-forward "
") - (if (looking-at - "by[ \t\n]+]+>\\([^<]+\\)[ \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]+]+>\\([^<]+\\)[ \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]+]+>\\([^<(]+\\) (\\([0-9]+\\))") + (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))))) @@ -247,8 +255,7 @@ (when (numberp article) (if (= article 1) (progn - (re-search-forward - "Posted by") + (search-forward "Posted by") (search-forward "
") (setq contents (buffer-substring @@ -462,11 +469,9 @@ (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) @@ -508,5 +513,5 @@ (provide 'nnslashdot) +;;; arch-tag: aa73df7a-f7e6-4eef-bdea-5ce2f8c691b3 ;;; nnslashdot.el ends here -