summaryrefslogtreecommitdiff
path: root/lisp/gnus/nnrss.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/nnrss.el')
-rw-r--r--lisp/gnus/nnrss.el41
1 files changed, 19 insertions, 22 deletions
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index c17a13c54c3..6168e5a281b 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -37,10 +37,7 @@
(require 'mm-url)
(require 'rfc2047)
(require 'mml)
-(eval-when-compile
- (ignore-errors
- (require 'xml)))
-(eval '(require 'xml))
+(require 'xml)
(nnoo-declare nnrss)
@@ -114,11 +111,11 @@ for decoding when the cdr that the data specify is not available.")
;;; Interface functions
(defsubst nnrss-format-string (string)
- (gnus-replace-in-string string " *\n *" " "))
+ (replace-regexp-in-string " *\n *" " " string))
(defun nnrss-decode-group-name (group)
(if (and group (mm-coding-system-p 'utf-8))
- (setq group (mm-decode-coding-string group 'utf-8))
+ (setq group (decode-coding-string group 'utf-8))
group))
(deffoo nnrss-retrieve-headers (articles &optional group server fetch-old)
@@ -243,7 +240,6 @@ for decoding when the cdr that the data specify is not available.")
(max 1 (/ (* (window-width window) 7) 8))))
(fill-region (point) (point-max))
(goto-char (point-max))
- ;; XEmacs version of `fill-region' inserts newline.
(unless (bolp)
(insert "\n"))))
(when (or link enclosure)
@@ -295,7 +291,7 @@ for decoding when the cdr that the data specify is not available.")
(let ((rfc2047-encoding-type 'mime)
rfc2047-encode-max-chars)
(rfc2047-encode-string
- (gnus-replace-in-string group "[\t\n ]+" "_")))))
+ (replace-regexp-in-string "[\t\n ]+" "_" group)))))
(when nnrss-content-function
(funcall nnrss-content-function e group article))))
(cond
@@ -372,8 +368,6 @@ for decoding when the cdr that the data specify is not available.")
(nnoo-define-skeleton nnrss)
;;; Internal functions
-(eval-when-compile (defun xml-rpc-method-call (&rest args)))
-
(defun nnrss-get-encoding ()
"Return an encoding attribute specified in the current xml contents.
If `nnrss-compatible-encoding-alist' specifies the compatible encoding,
@@ -417,7 +411,7 @@ otherwise return nil."
;; Decode text according to the encoding attribute.
(when (setq cs (nnrss-get-encoding))
(insert (prog1
- (mm-decode-coding-string (buffer-string) cs)
+ (decode-coding-string (buffer-string) cs)
(erase-buffer)
(mm-enable-multibyte))))
(goto-char (point-min))
@@ -588,12 +582,11 @@ which RSS 2.0 allows."
"")
(defun nnrss-insert (url)
- (mm-with-unibyte-current-buffer
- (condition-case err
- (mm-url-insert url)
- (error (if (or debug-on-quit debug-on-error)
- (signal (car err) (cdr err))
- (message "nnrss: Failed to fetch %s" url))))))
+ (condition-case err
+ (mm-url-insert url)
+ (error (if (or debug-on-quit debug-on-error)
+ (signal (car err) (cdr err))
+ (message "nnrss: Failed to fetch %s" url)))))
(defun nnrss-decode-entities-string (string)
(if string
@@ -763,7 +756,7 @@ Read the file and attempt to subscribe to each Feed in the file."
Export subscriptions to a buffer in OPML Format."
(interactive)
(with-current-buffer (get-buffer-create "*OPML Export*")
- (mm-set-buffer-file-coding-system 'utf-8)
+ (set-buffer-file-coding-system 'utf-8)
(insert "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<!-- OPML generated by Emacs Gnus' nnrss.el -->\n"
"<opml version=\"1.1\">\n"
@@ -810,10 +803,11 @@ It is useful when `(setq nnrss-use-local t)'."
(nnrss-node-just-text node)
node))
(cleaned-text (if text
- (gnus-replace-in-string
- (gnus-replace-in-string
- text "^[\000-\037\177]+\\|^ +\\| +$" "")
- "\r\n" "\n"))))
+ (replace-regexp-in-string
+ "\r\n" "\n"
+ (replace-regexp-in-string
+ "^[\000-\037\177]+\\|^ +\\| +$" ""
+ text)))))
(if (string-equal "" cleaned-text)
nil
cleaned-text)))
@@ -959,6 +953,9 @@ Use Mark Pilgrim's `ultra-liberal rss locator'."
;; 4. check syndic8
(nnrss-find-rss-via-syndic8 url))))))))
+(declare-function xml-rpc-method-call "ext:xml-rpc"
+ (server-url method &rest params))
+
(defun nnrss-find-rss-via-syndic8 (url)
"Query syndic8 for the rss feeds it has for URL."
(if (not (locate-library "xml-rpc"))