From b1c4ec00df67188b55f17502baeddce1f942b916 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 6 Dec 2001 08:27:53 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 11 +++++++++++ lisp/dgnushack.el | 3 +-- lisp/mm-url.el | 4 +++- lisp/nnrss.el | 37 ++++++++++++++----------------------- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 83a62d9..48efae9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2001-12-06 01:00:00 ShengHuo ZHU + + * dgnushack.el (dgnushack-compile): nnrss.el and + nnslashdot.el don't depend on nnweb, url, w3. + + * nnrss.el: Use mm-url. + +2001-12-06 00:00:00 ShengHuo ZHU + + * mm-url.el (mm-url-insert-file-contents): Support file:. + 2001-12-05 14:00:00 ShengHuo ZHU * mm-view.el: Lower case for the description line. Sync from the diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index 1f515ba..34aab07 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -463,8 +463,7 @@ Try to re-configure with --with-addpath=FLIM_PATH and run make again. (message " => ignored") nil))) '("nnweb.el" "nnlistserv.el" "nnultimate.el" - "nnslashdot.el" "nnwarchive.el" "webmail.el" - "nnwfm.el" "nnrss.el")) + "nnwarchive.el" "webmail.el" "nnwfm.el")) (condition-case code (progn (require 'mh-e) nil) (error diff --git a/lisp/mm-url.el b/lisp/mm-url.el index 79811f1..fb86298 100644 --- a/lisp/mm-url.el +++ b/lisp/mm-url.el @@ -248,7 +248,9 @@ This is taken from RFC 2396.") (defun mm-url-insert-file-contents (url) (if mm-url-use-external - (mm-url-insert-file-contents-external url) + (if (string-match "^file:/+" url) + (insert-file-contents (substring url (1- (match-end 0)))) + (mm-url-insert-file-contents-external url)) (url-insert-file-contents url))) (defun mm-url-insert-file-contents-external (url) diff --git a/lisp/nnrss.el b/lisp/nnrss.el index 61c1e9b..204e31f 100644 --- a/lisp/nnrss.el +++ b/lisp/nnrss.el @@ -27,6 +27,7 @@ (eval-when-compile (require 'cl)) +(require 'gnus) (require 'nnoo) (require 'nnmail) (require 'message) @@ -34,18 +35,12 @@ (require 'gnus-util) (require 'time-date) (require 'rfc2231) +(require 'mm-url) (eval-when-compile (ignore-errors - (require 'xml) - (require 'w3) - (require 'w3-forms) - (require 'nnweb))) + (require 'xml))) ;; Report failure to find w3 at load time if appropriate. -(eval '(progn - (require 'xml) - (require 'w3) - (require 'w3-forms) - (require 'nnweb))) +(eval '(require 'xml)) (nnoo-declare nnrss) @@ -447,23 +442,14 @@ To use the description in headers, put this name into `nnmail-extra-headers'.") (defun nnrss-no-cache (url) "") -;; TODO:: disable cache. -;; -;; (defun nnrss-insert-w3 (url) -;; (require 'url) -;; (require 'url-cache) -;; (let ((url-cache-creation-function 'nnrss-no-cache)) -;; (mm-with-unibyte-current-buffer -;; (nnweb-insert url)))) - (defun nnrss-insert-w3 (url) (mm-with-unibyte-current-buffer - (nnweb-insert url))) + (mm-url-insert url))) (defun nnrss-decode-entities-unibyte-string (string) (mm-with-unibyte-buffer (insert string) - (nnweb-decode-entities) + (mm-url-decode-entities) (buffer-substring (point-min) (point-max)))) (defalias 'nnrss-insert 'nnrss-insert-w3) @@ -475,7 +461,7 @@ To use the description in headers, put this name into `nnmail-extra-headers'.") ;;; Snarf functions (defun nnrss-check-group (group server) - (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)) + (let ((mm-url-html-entities (cons '(nbsp . 32) mm-url-html-entities)) file xml subject url extra changed author date) (condition-case err (mm-with-unibyte-buffer @@ -575,7 +561,7 @@ It is useful when `(setq nnrss-use-local t)'." (if (match-string 1) (setq category (match-string 1)) (setq url (match-string 2) - name (nnweb-decode-entities-string + name (mm-url-decode-entities-string (rfc2231-decode-encoded-string (match-string 3)))) (if category @@ -586,8 +572,13 @@ It is useful when `(setq nnrss-use-local t)'." (if changed (nnrss-save-server-data "")))) +(defun nnrss-replace-in-string (string match newtext) + (while (string-match match string) + (setq string (replace-match newtext t t string))) + string) + (defun nnrss-format-string (string) - (nnweb-replace-in-string (nnrss-string-as-multibyte string) " *\n *" " ")) + (nnrss-replace-in-string (nnrss-string-as-multibyte string) " *\n *" " ")) (defun nnrss-node-text (node) (if (and node (listp node)) -- 1.7.10.4