Mercurial > emacs
comparison lisp/gnus/nnlistserv.el @ 56927:55fd4f77387a after-merge-gnus-5_10
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Merge from emacs--gnus--5.10, gnus--rel--5.10
Patches applied:
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--base-0
tag of miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-1
Import from CVS branch gnus-5_10-branch
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-2
Merge from lorentey@elte.hu--2004/emacs--multi-tty--0, emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-3
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-4
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-18
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-19
Remove autoconf-generated files from archive
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-20
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 04 Sep 2004 13:13:48 +0000 |
parents | cb0bc8ce8e5a |
children | 18a818a2ee7c cce1c0ee76ee |
comparison
equal
deleted
inserted
replaced
56926:f8e248e9a717 | 56927:55fd4f77387a |
---|---|
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
23 ;; Boston, MA 02111-1307, USA. | 23 ;; Boston, MA 02111-1307, USA. |
24 | 24 |
25 ;;; Commentary: | 25 ;;; Commentary: |
26 | 26 |
27 ;; Note: You need to have `url' and `w3' installed for this | |
28 ;; backend to work. | |
29 | |
30 ;;; Code: | 27 ;;; Code: |
31 | 28 |
32 (eval-when-compile (require 'cl)) | 29 (eval-when-compile (require 'cl)) |
33 | 30 |
34 (require 'nnoo) | 31 (require 'nnoo) |
35 (eval-when-compile | 32 (require 'mm-url) |
36 (ignore-errors | 33 (require 'nnweb) |
37 (require 'nnweb)) ; requires W3 | |
38 (autoload 'url-insert-file-contents "nnweb")) | |
39 | 34 |
40 (nnoo-declare nnlistserv | 35 (nnoo-declare nnlistserv |
41 nnweb) | 36 nnweb) |
42 | 37 |
43 (defvoo nnlistserv-directory (nnheader-concat gnus-directory "nnlistserv/") | 38 (defvoo nnlistserv-directory (nnheader-concat gnus-directory "nnlistserv/") |
96 (while (setq page (pop pages)) | 91 (while (setq page (pop pages)) |
97 (erase-buffer) | 92 (erase-buffer) |
98 (when (funcall (nnweb-definition 'search) page) | 93 (when (funcall (nnweb-definition 'search) page) |
99 ;; Go through all the article hits on this page. | 94 ;; Go through all the article hits on this page. |
100 (goto-char (point-min)) | 95 (goto-char (point-min)) |
101 (nnweb-decode-entities) | 96 (mm-url-decode-entities) |
102 (goto-char (point-min)) | 97 (goto-char (point-min)) |
103 (while (re-search-forward "^<li> *<a href=\"\\([^\"]+\\)\"><b>\\([^\\>]+\\)</b></a> *<[^>]+><i>\\([^>]+\\)<" nil t) | 98 (while (re-search-forward "^<li> *<a href=\"\\([^\"]+\\)\"><b>\\([^\\>]+\\)</b></a> *<[^>]+><i>\\([^>]+\\)<" nil t) |
104 (setq url (match-string 1) | 99 (setq url (match-string 1) |
105 subject (match-string 2) | 100 subject (match-string 2) |
106 from (match-string 3)) | 101 from (match-string 3)) |
122 | 117 |
123 (defun nnlistserv-kk-wash-article () | 118 (defun nnlistserv-kk-wash-article () |
124 (let ((case-fold-search t) | 119 (let ((case-fold-search t) |
125 (headers '(sent name email subject id)) | 120 (headers '(sent name email subject id)) |
126 sent name email subject id) | 121 sent name email subject id) |
127 (nnweb-decode-entities) | 122 (mm-url-decode-entities) |
128 (while headers | 123 (while headers |
129 (goto-char (point-min)) | 124 (goto-char (point-min)) |
130 (re-search-forward (format "<!-- %s=\"\\([^\"]+\\)" (car headers)) nil t) | 125 (re-search-forward (format "<!-- %s=\"\\([^\"]+\\)" (car headers)) nil t) |
131 (set (pop headers) (match-string 1))) | 126 (set (pop headers) (match-string 1))) |
132 (goto-char (point-min)) | 127 (goto-char (point-min)) |
133 (search-forward "<!-- body" nil t) | 128 (search-forward "<!-- body" nil t) |
134 (delete-region (point-min) (progn (forward-line 1) (point))) | 129 (delete-region (point-min) (progn (forward-line 1) (point))) |
135 (goto-char (point-max)) | 130 (goto-char (point-max)) |
136 (search-backward "<!-- body" nil t) | 131 (search-backward "<!-- body" nil t) |
137 (delete-region (point-max) (progn (beginning-of-line) (point))) | 132 (delete-region (point-max) (progn (beginning-of-line) (point))) |
138 (nnweb-remove-markup) | 133 (mm-url-remove-markup) |
139 (goto-char (point-min)) | 134 (goto-char (point-min)) |
140 (insert (format "From: %s <%s>\n" name email) | 135 (insert (format "From: %s <%s>\n" name email) |
141 (format "Subject: %s\n" subject) | 136 (format "Subject: %s\n" subject) |
142 (format "Message-ID: %s\n" id) | 137 (format "Message-ID: %s\n" id) |
143 (format "Date: %s\n\n" sent)))) | 138 (format "Date: %s\n\n" sent)))) |
144 | 139 |
145 (defun nnlistserv-kk-search (search) | 140 (defun nnlistserv-kk-search (search) |
146 (url-insert-file-contents | 141 (mm-url-insert |
147 (concat (format (nnweb-definition 'address) search) | 142 (concat (format (nnweb-definition 'address) search) |
148 (nnweb-definition 'index))) | 143 (nnweb-definition 'index))) |
149 t) | 144 t) |
150 | 145 |
151 (defun nnlistserv-kk-identity (url) | 146 (defun nnlistserv-kk-identity (url) |