+2006-01-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * nnrss.el (nnrss-wash-html-in-text-plain-parts): New variable.
+ (nnrss-request-article): Render text/plain parts as HTML.
+
+ * gnus-art.el (gnus-article-wash-html-with-w3m): No need to narrow
+ the buffer.
+
+2006-01-08 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus-cus.el (gnus-group-parameters): Sync posting-style with
+ custom definition of `gnus-posting-styles'.
+
+ * gnus-start.el (gnus-gnus-to-quick-newsrc-format): Bind
+ print-circle. Suggested by Kalle Olavi Niemitalo <kon@iki.fi>.
+
+2006-01-05 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus-group.el (gnus-useful-groups): Use Gmane for ding. Use
+ nntp for bug archive.
+
+2006-01-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * nnrss.el (nnrss-request-article): Fix the way to fill text/plain
+ parts.
+ (nnrss-normalize-date): New function converts ISO 8601 date into
+ RFC822 style. Suggested by Mark Plaksin <happy@mcplaksin.org>.
+ (nnrss-check-group): Use it.
+
+2006-01-03 Rodrigo Ventura <yoda@isr.ist.utl.pt> (tiny change)
+
+ * gnus-xmas.el (gnus-xmas-group-startup-message): Typo
+ gnus-splash-face -> gnus-splash. Fixes starting from a TTY in
+ XEmacs.
+
+2006-01-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-sum.el (gnus-summary-work-articles): Remove useless `min'.
+
+ * nnrss.el (nnrss-fetch): Make it fail gracefully when it can't
+ fetch a feed. Suggested by Mark Plaksin <happy@mcplaksin.org>.
+ (nnrss-insert-w3): Ditto.
+
+2005-12-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * nnrss.el (nnrss-request-article): Fix last change; fill
+ text/plain parts.
+
+2005-12-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * nnrss.el (nnrss-request-article): Replace <br />s with newlines
+ in text/plain part.
+ (nnrss-check-group): Don't add excessive newline to dc:subject.
+
+2005-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (gnus-article-delete-text-of-type): Enable it to
+ remove MIME buttons associated with multipart/alternative parts.
+ (gnus-mime-display-alternative): Tag buttons using `article-type'
+ text property.
+
+ * gnus-msg.el (gnus-copy-article-buffer): Remove MIME buttons
+ associated with multipart/alternative parts.
+
+2005-12-19 Mark Plaksin <happy@mcplaksin.org> (tiny change)
+
+ * nnrss.el (nnrss-check-group): Put the RSS dc:subject in the
+ article.
+
+2005-12-18 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * dns.el (query-dns): Make sure we check the buffer size before
+ removing tcp headers.
+
2006-01-08 Chong Yidong <cyd@stupidchicken.com>
* spam.el (spam-group-ham-mark-p, spam-group-spam-mark-p)
(decf times step))
(ignore-errors
(delete-process process))
- (when tcp-p
+ (when (and tcp-p
+ (>= (buffer-size) 2))
(goto-char (point-min))
(delete-region (point) (+ (point) 2)))
(unless (zerop (buffer-size))
"Delete text of TYPE in the current buffer."
(save-excursion
(let ((b (point-min)))
- (while (setq b (text-property-any b (point-max) 'article-type type))
- (delete-region
- b (or (text-property-not-all b (point-max) 'article-type type)
- (point-max)))))))
+ (if (eq type 'multipart)
+ ;; Remove MIME buttons associated with multipart/alternative parts.
+ (progn
+ (goto-char b)
+ (while (if (get-text-property (point) 'gnus-part)
+ (setq b (point))
+ (when (setq b (next-single-property-change (point)
+ 'gnus-part))
+ (goto-char b)
+ t))
+ (end-of-line)
+ (skip-chars-forward "\n")
+ (when (eq (get-text-property b 'article-type) 'multipart)
+ (delete-region b (point)))))
+ (while (setq b (text-property-any b (point-max) 'article-type type))
+ (delete-region
+ b (or (text-property-not-all b (point-max) 'article-type type)
+ (point-max))))))))
(defun gnus-article-delete-invisible-text ()
"Delete all invisible text in the current buffer."
(defun gnus-article-wash-html-with-w3m ()
"Wash the current buffer with emacs-w3m."
(mm-setup-w3m)
- (save-restriction
- (narrow-to-region (point) (point-max))
- (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp)
- w3m-force-redisplay)
- (w3m-region (point-min) (point-max)))
- (when (and mm-inline-text-html-with-w3m-keymap
- (boundp 'w3m-minor-mode-map)
- w3m-minor-mode-map)
- (add-text-properties
- (point-min) (point-max)
- (list 'keymap w3m-minor-mode-map
- ;; Put the mark meaning this part was rendered by emacs-w3m.
- 'mm-inline-text-html-with-w3m t)))))
+ (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp)
+ w3m-force-redisplay)
+ (w3m-region (point-min) (point-max)))
+ (when (and mm-inline-text-html-with-w3m-keymap
+ (boundp 'w3m-minor-mode-map)
+ w3m-minor-mode-map)
+ (add-text-properties
+ (point-min) (point-max)
+ (list 'keymap w3m-minor-mode-map
+ ;; Put the mark meaning this part was rendered by emacs-w3m.
+ 'mm-inline-text-html-with-w3m t))))
(defun article-hide-list-identifiers ()
"Remove list identifies from the Subject header.
,gnus-mouse-face-prop ,gnus-article-mouse-face
face ,gnus-article-button-face
gnus-part ,id
- gnus-data ,handle))
+ article-type multipart))
(widget-convert-button 'link from (point)
:action 'gnus-widget-press-button
:button-keymap gnus-widget-button-keymap)
(const signature-file)
(const organization)
(const address)
+ (const x-face-file)
(const name)
- (const body))
+ (const body)
+ (symbol)
+ (string :tag "Header"))
(string :format "%v"))))
"post style.
See `gnus-posting-styles'."))
:type 'hook)
(defcustom gnus-useful-groups
- '(("(ding) mailing list mirrored at sunsite.auc.dk"
- "emacs.ding"
- (nntp "sunsite.auc.dk"
- (nntp-address "sunsite.auc.dk")))
- ("gnus-bug archive"
- "gnus-bug"
- (nndir "/ftp@ftp.ifi.uio.no:/pub/emacs/gnus/gnus-bug/"))
- ("Gnus help group"
+ '(("(ding) mailing list mirrored at gmane.org"
+ "gmane.emacs.gnus.general"
+ (nntp "Gmane"
+ (nntp-address "news.gmane.org")))
+ ("Gnus bug archive"
+ "gnus.gnus-bug"
+ (nntp "news.gnus.org"
+ (nntp-address "news.gnus.org")))
+ ("Local Gnus help group"
"gnus-help"
(nndoc "gnus-help"
(nndoc-article-type mbox)
(delete-region (point) (point-max))
(insert yank-string))
(gnus-article-delete-text-of-type 'annotation)
+ (gnus-article-delete-text-of-type 'multipart)
(gnus-remove-text-with-property 'gnus-prev)
(gnus-remove-text-with-property 'gnus-next)
(gnus-remove-text-with-property 'gnus-decoration)
(print-escape-nonascii t)
(print-length nil)
(print-level nil)
+ (print-circle nil)
(print-escape-newlines t)
(gnus-killed-list
(if (and gnus-save-killed-list
(let ((max (max (point) (mark)))
articles article)
(save-excursion
- (goto-char (min (min (point) (mark))))
+ (goto-char (min (point) (mark)))
(while
(and
(push (setq article (gnus-summary-article-number)) articles)
(defvar nnrss-compatible-encoding-alist '((iso-8859-1 . windows-1252))
"Alist of encodings and those supersets.
The cdr of each element is used to decode data if it is available when
-the car is what the data specify as the encoding. Or, the car is used
+the car is what the data specify as the encoding. Or, the car is used
for decoding when the cdr that the data specify is not available.")
+(defvar nnrss-wash-html-in-text-plain-parts nil
+ "*Non-nil means render text in text/plain parts as HTML.
+The function specified by the `mm-text-html-renderer' variable will be
+used to render text. If it is nil, text will simply be folded.")
+
(nnoo-define-basics nnrss)
;;; Interface functions
(deffoo nnrss-close-group (group &optional server)
t)
+(eval-when-compile
+ (defvar mm-text-html-renderer)
+ (defvar mm-text-html-washer-alist))
+
(deffoo nnrss-request-article (article &optional group server buffer)
(setq group (nnrss-decode-group-name group))
(when (stringp article)
(if (nth 5 e)
(insert "Date: " (nnrss-format-string (nth 5 e)) "\n"))
(let ((header (buffer-string))
- (text (if (nth 6 e)
- (mapconcat 'identity
- (delete "" (split-string (nth 6 e) "\n+"))
- " ")))
+ (text (nth 6 e))
(link (nth 2 e))
(enclosure (nth 7 e))
(comments (nth 8 e))
(cons '("Newsgroups" . utf-8)
rfc2047-header-encoding-alist)
rfc2047-header-encoding-alist))
- rfc2047-encode-encoded-words body)
+ rfc2047-encode-encoded-words body fn)
(when (or text link enclosure comments)
(insert "\n")
(insert "<#multipart type=alternative>\n"
"<#part type=\"text/plain\">\n")
(setq body (point))
(when text
- (insert text "\n")
+ (insert text)
+ (goto-char body)
+ (if (and nnrss-wash-html-in-text-plain-parts
+ (progn
+ (require 'mm-view)
+ (setq fn (or (cdr (assq mm-text-html-renderer
+ mm-text-html-washer-alist))
+ mm-text-html-renderer))))
+ (progn
+ (narrow-to-region body (point-max))
+ (if (functionp fn)
+ (funcall fn)
+ (apply (car fn) (cdr fn)))
+ (widen)
+ (goto-char body)
+ (re-search-forward "[^\t\n ]" nil t)
+ (beginning-of-line)
+ (delete-region body (point))
+ (goto-char (point-max))
+ (skip-chars-backward "\t\n ")
+ (end-of-line)
+ (delete-region (point) (point-max))
+ (insert "\n"))
+ (while (re-search-forward "\n+" nil t)
+ (replace-match " "))
+ (goto-char body)
+ ;; See `nnrss-check-group', which inserts "<br /><br />".
+ (when (search-forward "<br /><br />" nil t)
+ (if (eobp)
+ (replace-match "\n")
+ (replace-match "\n\n")))
+ (unless (eobp)
+ (let ((fill-column default-fill-column)
+ (window (get-buffer-window nntp-server-buffer)))
+ (when window
+ (setq fill-column
+ (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)
(insert "\n")))
(when link
;; FIXME: shouldn't binding `coding-system-for-read' be moved
;; to `mm-url-insert'?
(let ((coding-system-for-read 'binary))
- (mm-url-insert 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))))))
(nnheader-remove-cr-followed-by-lf)
;; Decode text according to the encoding attribute.
(when (setq cs (nnrss-get-encoding))
(unless (assoc (car elem) nnrss-group-alist)
(insert (prin1-to-string (car elem)) " 0 1 y\n")))))
+(eval-and-compile (autoload 'timezone-parse-date "timezone"))
+
+(defun nnrss-normalize-date (date)
+ "Return a date string of DATE in the RFC822 style.
+This function handles the ISO 8601 date format described in
+<URL:http://www.w3.org/TR/NOTE-datetime>, and also the RFC822 style
+which RSS 2.0 allows."
+ (let (case-fold-search vector year month day time zone cts)
+ (cond ((null date))
+ ;; RFC822
+ ((string-match " [0-9]+ " date)
+ (setq vector (timezone-parse-date date)
+ year (string-to-number (aref vector 0)))
+ (when (>= year 1969)
+ (setq month (string-to-number (aref vector 1))
+ day (string-to-number (aref vector 2)))
+ (unless (>= (length (setq time (aref vector 3))) 3)
+ (setq time "00:00:00"))
+ (when (and (setq zone (aref vector 4))
+ (not (string-match "\\`[A-Z+-]" zone)))
+ (setq zone nil))))
+ ;; ISO 8601
+ ((string-match
+ (eval-when-compile
+ (concat
+ ;; 1. year
+ "\\(199[0-9]\\|20[0-9][0-9]\\)"
+ "\\(-"
+ ;; 3. month
+ "\\([01][0-9]\\)"
+ "\\(-"
+ ;; 5. day
+ "\\([0-3][0-9]\\)"
+ "\\)?\\)?\\(T"
+ ;; 7. hh:mm
+ "\\([012][0-9]:[0-5][0-9]\\)"
+ "\\("
+ ;; 9. :ss
+ "\\(:[0-5][0-9]\\)"
+ "\\(\\.[0-9]+\\)?\\)?\\)?"
+ ;; 13+14,15,16. zone
+ "\\(\\(\\([+-][012][0-9]\\):\\([0-5][0-9]\\)\\)"
+ "\\|\\([+-][012][0-9][0-5][0-9]\\)"
+ "\\|\\(Z\\)\\)?"))
+ date)
+ (setq year (string-to-number (match-string 1 date))
+ month (string-to-number (or (match-string 3 date) "1"))
+ day (string-to-number (or (match-string 5 date) "1"))
+ time (if (match-beginning 9)
+ (substring date (match-beginning 7) (match-end 9))
+ (concat (or (match-string 7 date) "00:00") ":00"))
+ zone (cond ((match-beginning 13)
+ (concat (match-string 13 date)
+ (match-string 14 date)))
+ ((match-beginning 16) ;; Z
+ "+0000")
+ (t ;; nil if zone is not provided.
+ (match-string 15 date))))))
+ (if month
+ (progn
+ (setq cts (current-time-string (encode-time 0 0 0 day month year)))
+ (format "%s, %02d %s %04d %s%s"
+ (substring cts 0 3) day (substring cts 4 7) year time
+ (if zone
+ (concat " " zone)
+ "")))
+ (message-make-date))))
+
;;; data functions
(defun nnrss-read-server-data (server)
(defun nnrss-insert-w3 (url)
(mm-with-unibyte-current-buffer
- (mm-url-insert 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
;;; Snarf functions
(defun nnrss-check-group (group server)
- (let (file xml subject url extra changed author date
+ (let (file xml subject url extra changed author date feed-subject
enclosure comments rss-ns rdf-ns content-ns dc-ns)
(if (and nnrss-use-local
(file-exists-p (setq file (expand-file-name
(setq extra (or extra
(nnrss-node-text content-ns 'encoded item)
(nnrss-node-text rss-ns 'description item)))
+ (if (setq feed-subject (nnrss-node-text dc-ns 'subject item))
+ (setq extra (concat feed-subject "<br /><br />" extra)))
(setq author (or (nnrss-node-text rss-ns 'author item)
(nnrss-node-text dc-ns 'creator item)
(nnrss-node-text dc-ns 'contributor item)))
- (setq date (or (nnrss-node-text dc-ns 'date item)
- (nnrss-node-text rss-ns 'pubDate item)
- (message-make-date)))
+ (setq date (nnrss-normalize-date
+ (or (nnrss-node-text dc-ns 'date item)
+ (nnrss-node-text rss-ns 'pubDate item))))
(setq comments (nnrss-node-text rss-ns 'comments item))
(when (setq enclosure (cadr (assq (intern (concat rss-ns "enclosure")) item)))
(let ((url (cdr (assq 'url enclosure)))
+2006-01-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus.texi (RSS): Document nnrss-wash-html-in-text-plain-parts.
+
+2006-01-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus.texi (RSS): Addition.
+
+2005-12-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus.texi (Summary Post Commands): Fix function bound to `S O p'.
+
+2005-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * emacs-mime.texi (Display Customization): Add setting example to
+ mm-discouraged-alternatives.
+
2006-01-09 Stefan Monnier <monnier@iro.umontreal.ca>
* flymake.texi (Obtaining Flymake): Remove chapter since Emacs's
@end lisp
Adding @code{"image/.*"} might also be useful. Spammers use it as the
-prefered part of @samp{multipart/alternative} messages. See also
+prefered part of @samp{multipart/alternative} messages, and you might
+not notice there are other parts. See also
@code{gnus-buttonized-mime-types} (@pxref{MIME Commands, ,MIME Commands,
gnus, Gnus Manual}), to which adding @code{"multipart/alternative"}
enables you to choose manually one of two types those mails include.
+For example, you can set those variables like:
+
+@lisp
+(setq gnus-buttonized-mime-types
+ '("multipart/alternative" "multipart/signed")
+ mm-discouraged-alternatives
+ '("text/html" "image/.*"))
+@end lisp
+
+In this case, Gnus will display radio buttons for such a kind of spam
+message as follows:
+
+@example
+1. (*) multipart/alternative ( ) image/gif
+
+2. (*) text/plain ( ) text/html
+@end example
@item mm-inline-large-images
@vindex mm-inline-large-images
@cindex digests
@cindex making digests
Digest the current series and forward the result to a newsgroup
-(@code{gnus-uu-digest-mail-forward}). This command uses the
+(@code{gnus-uu-digest-post-forward}). This command uses the
process/prefix convention.
@item S u
XEmacs and want to use non-@acronym{ASCII} group names, you should set
the value for the @code{nnmail-pathname-coding-system} variable properly.
+The @code{nnrss} back end generates @samp{multipart/alternative}
+@acronym{MIME} articles in which each contains a @samp{text/plain} part
+and a @samp{text/html} part.
+
@cindex OPML
You can also use the following commands to import and export your
subscriptions from a file in @acronym{OPML} format (Outline Processor
the feeds from local files in @code{nnrss-directory}. You can use
the command @code{nnrss-generate-download-script} to generate a
download script using @command{wget}.
+
+@item nnrss-wash-html-in-text-plain-parts
+Non-@code{nil} means that @code{nnrss} renders text in @samp{text/plain}
+parts as @acronym{HTML}. The function specified by the
+@code{mm-text-html-renderer} variable (@pxref{Display Customization,
+,Display Customization, emacs-mime, The Emacs MIME Manual}) will be used
+to render text. If it is @code{nil}, which is the default, text will
+simply be folded. Leave it @code{nil} if you prefer to see
+@samp{text/html} parts.
@end table
The following code may be helpful, if you want to show the description in
The following code may be useful to open an nnrss url directly from the
summary buffer.
+
@lisp
(require 'browse-url)
(add-to-list 'nnmail-extra-headers nnrss-url-field)
@end lisp
+Even if you have added @code{"text/html"} to the
+@code{mm-discouraged-alternatives} variable (@pxref{Display
+Customization, ,Display Customization, emacs-mime, The Emacs MIME
+Manual}) since you don't want to see @acronym{HTML} parts, it might be
+more useful especially in @code{nnrss} groups to display
+@samp{text/html} parts. Here's an example of setting
+@code{mm-discouraged-alternatives} as a group parameter (@pxref{Group
+Parameters}) in order to display @samp{text/html} parts only in
+@code{nnrss} groups:
+
+@lisp
+;; @r{Set the default value of @code{mm-discouraged-alternatives}.}
+(eval-after-load "gnus-sum"
+ '(add-to-list
+ 'gnus-newsgroup-variables
+ '(mm-discouraged-alternatives
+ . '("text/html" "image/.*"))))
+
+;; @r{Display @samp{text/html} parts in @code{nnrss} groups.}
+(add-to-list
+ 'gnus-parameters
+ '("\\`nnrss:" (mm-discouraged-alternatives nil)))
+@end lisp
+
+
@node Customizing W3
@subsection Customizing W3
@cindex W3