(delete "" (split-string (nth 6 e) "\n+"))
" ")))
(link (nth 2 e))
- (enclosure (nth 7 e))
+ (enclosure (nth 7 e))
;; Enable encoding of Newsgroups header in XEmacs.
(default-enable-multibyte-characters t)
(rfc2047-header-encoding-alist
"<#part type=\"text/plain\">\n")
(setq body (point))
(when text
- (insert text "\n")
- (when (or link enclosure)
- (insert "\n")))
- (when link
- (insert link "\n"))
- (when enclosure
- (insert (car enclosure) " "
- (nth 2 enclosure) " "
- (nth 3 enclosure) "\n"))
+ (insert text "\n")
+ (when (or link enclosure)
+ (insert "\n")))
+ (when link
+ (insert link "\n"))
+ (when enclosure
+ (insert (car enclosure) " "
+ (nth 2 enclosure) " "
+ (nth 3 enclosure) "\n"))
(setq body (buffer-substring body (point)))
(insert "<#/part>\n"
"<#part type=\"text/html\">\n"
(insert text "\n"))
(when link
(insert "<p><a href=\"" link "\">link</a></p>\n"))
- (when enclosure
- (insert "<p><a href=\"" (car enclosure) "\">"
- (cadr enclosure) "</a> " (nth 2 enclosure)
- " " (nth 3 enclosure) "</p>\n"))
+ (when enclosure
+ (insert "<p><a href=\"" (car enclosure) "\">"
+ (cadr enclosure) "</a> " (nth 2 enclosure)
+ " " (nth 3 enclosure) "</p>\n"))
(insert "</body></html>\n"
"<#/part>\n"
"<#/multipart>\n"))
(defun nnrss-check-group (group server)
(let (file xml subject url extra changed author date
- enclosure rss-ns rdf-ns content-ns dc-ns)
+ enclosure rss-ns rdf-ns content-ns dc-ns)
(if (and nnrss-use-local
(file-exists-p (setq file (expand-file-name
(nnrss-translate-file-chars
(setq date (or (nnrss-node-text dc-ns 'date item)
(nnrss-node-text rss-ns 'pubDate item)
(message-make-date)))
- (when (setq enclosure (cadr (assq (intern (concat rss-ns "enclosure")) item)))
- (let ((url (cdr (assq 'url enclosure)))
- (len (cdr (assq 'length enclosure)))
- (type (cdr (assq 'type enclosure)))
- (name))
- (setq len
- (if (and len (integerp (setq len (string-to-number len))))
- ;; actually already in `ls-lisp-format-file-size' but
- ;; probably not worth to require it for one function
- (do ((size (/ len 1.0) (/ size 1024.0))
- (post-fixes (list "" "k" "M" "G" "T" "P" "E")
- (cdr post-fixes)))
- ((< size 1024)
- (format "%.1f%s" size (car post-fixes))))
- "0"))
- (setq url (or url ""))
- (setq name (if (string-match "/\\([^/]*\\)$" url)
- (match-string 1 url)
- "file"))
- (setq type (or type ""))
- (setq enclosure (list url name len type))))
+ (when (setq enclosure (cadr (assq (intern (concat rss-ns "enclosure")) item)))
+ (let ((url (cdr (assq 'url enclosure)))
+ (len (cdr (assq 'length enclosure)))
+ (type (cdr (assq 'type enclosure)))
+ (name))
+ (setq len
+ (if (and len (integerp (setq len (string-to-number len))))
+ ;; actually already in `ls-lisp-format-file-size' but
+ ;; probably not worth to require it for one function
+ (do ((size (/ len 1.0) (/ size 1024.0))
+ (post-fixes (list "" "k" "M" "G" "T" "P" "E")
+ (cdr post-fixes)))
+ ((< size 1024)
+ (format "%.1f%s" size (car post-fixes))))
+ "0"))
+ (setq url (or url ""))
+ (setq name (if (string-match "/\\([^/]*\\)$" url)
+ (match-string 1 url)
+ "file"))
+ (setq type (or type ""))
+ (setq enclosure (list url name len type))))
(push
(list
(incf nnrss-group-max)
(and author (nnrss-mime-encode-string author))
date
(and extra (nnrss-decode-entities-string extra))
- enclosure)
+ enclosure)
nnrss-group-data)
(puthash (or url extra) t nnrss-group-hashtb)
(setq changed t))