Merge from emacs--devo--0, emacs--rel--22
[gnus] / lisp / nnweb.el
index a89e597..83b2306 100644 (file)
@@ -1,7 +1,7 @@
 ;;; nnweb.el --- retrieving articles via web search engines
 
 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -10,7 +10,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -294,12 +294,12 @@ Valid types include `google', `dejanews', and `gmane'.")
   "Initialize buffers and such."
   (unless (gnus-buffer-live-p nnweb-buffer)
     (setq nnweb-buffer
-         (save-excursion
-           (mm-with-unibyte
-             (nnheader-set-temp-buffer
-              (format " *nnweb %s %s %s*"
-                      nnweb-type nnweb-search server))
-             (current-buffer))))))
+         (save-current-buffer
+            (nnheader-set-temp-buffer
+             (format " *nnweb %s %s %s*"
+                     nnweb-type nnweb-search server))
+            (mm-disable-multibyte)
+            (current-buffer)))))
 
 ;;;
 ;;; groups.google.com
@@ -367,13 +367,15 @@ Valid types include `google', `dejanews', and `gmane'.")
       (goto-char (point-max))
       (when
          (re-search-backward
-          "^\\(\\w+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)? by \\(.*\\)"
+          "^\\(?:\\(\\w+\\) \\([0-9]+\\)\\|\\S-+\\)\\(?: \\([0-9]\\{4\\}\\)\\)? by ?\\(.*\\)"
           nil t)
-       (setq Date (format "%s %s 00:00:00 %s"
-                          (match-string 1)
-                          (match-string 2)
-                          (or (match-string 3)
-                              (substring (current-time-string) -4))))
+       (setq Date (if (match-string 1)
+                      (format "%s %s 00:00:00 %s"
+                              (match-string 1)
+                              (match-string 2)
+                              (or (match-string 3)
+                                  (substring (current-time-string) -4)))
+                    (current-time-string)))
        (setq From (match-string 4)))
       (widen)
       (incf i)
@@ -542,7 +544,11 @@ Valid types include `google', `dejanews', and `gmane'.")
 (defun nnweb-insert-html (parse)
   "Insert HTML based on a w3 parse tree."
   (if (stringp parse)
-      (insert (nnheader-string-as-multibyte parse))
+      ;; We used to call nnheader-string-as-multibyte here, but it cannot
+      ;; be right, so I removed it.  If a bug shows up because of this change,
+      ;; please do not blindly revert the change, but help me find the real
+      ;; cause of the bug instead.  --Stef
+      (insert parse)
     (insert "<" (symbol-name (car parse)) " ")
     (insert (mapconcat
             (lambda (param)
@@ -608,5 +614,5 @@ Valid types include `google', `dejanews', and `gmane'.")
 
 (provide 'nnweb)
 
-;;; arch-tag: f59307eb-c90f-479f-b7d2-dbd8bf51b697
+;; arch-tag: f59307eb-c90f-479f-b7d2-dbd8bf51b697
 ;;; nnweb.el ends here