X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnweb.el;h=b6b0ddd41a9dd44e9cdf39e30a9f24f080fbadfc;hb=4d937f23aa7b05296580330016306bdd3ed0c1f4;hp=2f99d9d607bafa90bf6d1a7d584e4e03a71b456f;hpb=429eae07fdc1416084f35802a381a4a956b201d1;p=gnus diff --git a/lisp/nnweb.el b/lisp/nnweb.el index 2f99d9d60..b6b0ddd41 100644 --- a/lisp/nnweb.el +++ b/lisp/nnweb.el @@ -1,17 +1,17 @@ ;;; nnweb.el --- retrieving articles via web search engines ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -;; 2004, 2005, 2006 Free Software Foundation, Inc. +;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; Keywords: news ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; 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) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,9 +19,7 @@ ;; GNU General Public License for more details. ;; 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., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -294,12 +292,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 @@ -360,22 +358,24 @@ Valid types include `google', `dejanews', and `gmane'.") (goto-char (point-max)) (widen) (narrow-to-region (point) - (search-forward "\" \n\t]+\\)[^<]*]+next" + "]+href=\"\n?\\([^>\" \n\t]+\\)[^<]*]+src=[^>]+next" nil t)) (>= i nnweb-max-hits)) (setq more nil) @@ -479,7 +479,7 @@ Valid types include `google', `dejanews', and `gmane'.") (from (mail-header-from header)) (subject (mail-header-subject header)) (rfc2047-encoding-type 'mime)) - (when (string-match " \\([^:]+\\):\\([0-9]+\\)" xref) + (when (string-match " \\([^:]+\\)[:/]\\([0-9]+\\)" xref) (mail-header-set-xref header (format "http://article.gmane.org/%s/%s/raw" @@ -495,11 +495,8 @@ Valid types include `google', `dejanews', and `gmane'.") (rfc2047-encode-string subject)) (unless (nnweb-get-hashtb (mail-header-xref header)) - (push - (list - (incf (cdr active)) - header) - map) + (mail-header-set-number header (incf (cdr active))) + (push (list (mail-header-number header) header) map) (nnweb-set-hashtb (cadar map) (car map)))))) (forward-line 1))) (nnheader-message 7 "Searching Gmane...done") @@ -524,7 +521,9 @@ Valid types include `google', `dejanews', and `gmane'.") "?" (mm-url-encode-www-form-urlencoded `(("query" . ,search) - ("HITSPERPAGE" . ,(number-to-string nnweb-max-hits)))))) + ("HITSPERPAGE" . ,(number-to-string nnweb-max-hits)) + ;;("TOPDOC" . "1000") + )))) (setq buffer-file-name nil) (set-buffer-multibyte t) (mm-decode-coding-region (point-min) (point-max) 'utf-8) @@ -543,7 +542,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) @@ -609,5 +612,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