Commit 877173ab authored by Miles Bader's avatar Miles Bader


Merge from emacs--cvs-trunk--0

Patches applied:

 * emacs--cvs-trunk--0  (patch 698-699)

   - Merge from gnus--rel--5.10
   - Update from CVS

 * gnus--rel--5.10  (patch 182-184)

   - Merge from emacs--cvs-trunk--0
   - Update from CVS
parents 41882805 73043f7d
2006-01-16 Katsumi Yamaoka <>
* mm-uu.el (mm-uu-text-plain-type): New variable.
(mm-uu-pgp-signed-extract-1): Use it.
(mm-uu-pgp-encrypted-extract-1): Use it.
(mm-uu-dissect): Use it; allow two optional arguments; one is a
flag specifying whether there's no message header; the other is
for a MIME type and parameters; bind mm-uu-text-plain-type with
the later one.
(mm-uu-dissect-text-parts): New function.
* gnus-art.el (gnus-display-mime): Use mm-uu-dissect-text-parts to
dissect text parts.
2006-01-13 Katsumi Yamaoka <>
* gnus-art.el (article-wash-html): Use
gnus-summary-show-article-charset-alist if a numeric arg is given.
(gnus-article-wash-html-with-w3m-standalone): New function.
* mm-view.el (mm-text-html-renderer-alist): Map w3m-standalone to
(mm-text-html-washer-alist): Map w3m-standalone to
(mm-inline-text-html-render-with-w3m-standalone): New function.
2006-01-10 Katsumi Yamaoka <>
* nnrss.el (nnrss-wash-html-in-text-plain-parts): New variable.
......@@ -2467,25 +2467,36 @@ If READ-CHARSET, ask for a coding system."
(defun article-wash-html (&optional read-charset)
"Format an HTML article.
If READ-CHARSET, ask for a coding system."
If READ-CHARSET, ask for a coding system. If it is a number, the
charset defined in `gnus-summary-show-article-charset-alist' is used."
(interactive "P")
(let ((inhibit-read-only t)
(when (gnus-buffer-live-p gnus-original-article-buffer)
(with-current-buffer gnus-original-article-buffer
(let* ((ct (gnus-fetch-field "content-type"))
(ctl (and ct
(mail-header-parse-content-type ct)))))
(setq charset (and ctl
(mail-content-type-get ctl 'charset)))
(when (stringp charset)
(setq charset (intern (downcase charset)))))))
(when read-charset
(setq charset (mm-read-coding-system "Charset: " charset)))
(unless charset
(setq charset gnus-newsgroup-charset))
(if read-charset
(if (or (and (numberp read-charset)
(setq charset
(assq read-charset
(setq charset (mm-read-coding-system "Charset: ")))
(let ((gnus-summary-show-article-charset-alist
(list (cons 1 charset))))
(with-current-buffer gnus-summary-buffer
(gnus-summary-show-article 1)))
(error "No charset is given"))
(when (gnus-buffer-live-p gnus-original-article-buffer)
(with-current-buffer gnus-original-article-buffer
(let* ((ct (gnus-fetch-field "content-type"))
(ctl (and ct
(mail-header-parse-content-type ct)))))
(setq charset (and ctl
(mail-content-type-get ctl 'charset)))
(when (stringp charset)
(setq charset (intern (downcase charset)))))))
(unless charset
(setq charset gnus-newsgroup-charset)))
......@@ -2526,6 +2537,20 @@ If READ-CHARSET, ask for a coding system."
;; Put the mark meaning this part was rendered by emacs-w3m.
'mm-inline-text-html-with-w3m t))))
(eval-when-compile (defvar charset)) ;; Bound by `article-wash-html'.
(defun gnus-article-wash-html-with-w3m-standalone ()
"Wash the current buffer with w3m."
(unless (mm-coding-system-p charset)
;; The default.
(setq charset 'iso-8859-1))
(let ((coding-system-for-write charset)
(coding-system-for-read charset))
(point-min) (point-max)
"w3m" t t nil "-dump" "-T" "text/html"
"-I" (symbol-name charset) "-O" (symbol-name charset))))
(defun article-hide-list-identifiers ()
"Remove list identifies from the Subject header.
The `gnus-list-identifiers' variable specifies what to do."
......@@ -4718,11 +4743,15 @@ N is the numerical prefix."
;; We have to do this since selecting the window
;; may change the point. So we set the window point.
(set-window-point window point)))
(let* ((handles (or ihandles
(mm-dissect-buffer nil gnus-article-loose-mime)
(and gnus-article-emulate-mime
(inhibit-read-only t) handle name type b e display)
(let ((handles ihandles)
(inhibit-read-only t)
(cond (handles)
((setq handles (mm-dissect-buffer nil gnus-article-loose-mime))
(when gnus-article-emulate-mime
(mm-uu-dissect-text-parts handles)))
(setq handles (mm-uu-dissect))))
(when (and (not ihandles)
(not gnus-displaying-mime))
;; Top-level call; we clean up.
......@@ -174,6 +174,10 @@ To disable dissecting shar codes, for instance, add
:group 'gnus-article-mime)
(defvar mm-uu-text-plain-type '("text/plain" (charset . gnus-decoded))
"MIME type and parameters for text/plain parts.
`gnus-decoded' is a fake charset, which means no further decoding.")
;; functions
(defsubst mm-uu-type (entry)
......@@ -375,7 +379,7 @@ Return that buffer."
(while (re-search-forward "^- " nil t)
(replace-match "" t t)
(forward-line 1)))
(list (mm-make-handle buf '("text/plain" (charset . gnus-decoded))))))
(list (mm-make-handle buf mm-uu-text-plain-type))))
(defun mm-uu-pgp-signed-extract ()
(let ((mm-security-handle (list (format "multipart/signed"))))
......@@ -407,9 +411,7 @@ Return that buffer."
(with-current-buffer buf
(funcall (mml2015-clear-decrypt-function))))
(mm-make-handle buf
'("text/plain" (charset . gnus-decoded))))))
(list (mm-make-handle buf mm-uu-text-plain-type))))
(defun mm-uu-pgp-encrypted-extract ()
(let ((mm-security-handle (list (format "multipart/encrypted"))))
......@@ -443,23 +445,24 @@ Return that buffer."
(defun mm-uu-dissect ()
"Dissect the current buffer and return a list of uu handles."
(defun mm-uu-dissect (&optional noheader mime-type)
"Dissect the current buffer and return a list of uu handles.
The optional NOHEADER means there's no header in the buffer.
MIME-TYPE specifies a MIME type and parameters, which defaults to the
value of `mm-uu-text-plain-type'."
(let ((case-fold-search t)
text-start start-point end-point file-name result
text-plain-type entry func)
(mm-uu-text-plain-type (or mime-type mm-uu-text-plain-type))
text-start start-point end-point file-name result entry func)
(goto-char (point-min))
((looking-at "\n")
((search-forward "\n\n" nil t)
(t (goto-char (point-max))))
;;; gnus-decoded is a fake charset, which means no further
;;; decoding.
(setq text-start (point)
text-plain-type '("text/plain" (charset . gnus-decoded)))
(setq text-start (point))
(while (re-search-forward mm-uu-beginning-regexp nil t)
(setq start-point (match-beginning 0))
(let ((alist mm-uu-type-alist)
......@@ -488,7 +491,7 @@ Return that buffer."
(re-search-forward "." start-point t)))
(mm-make-handle (mm-uu-copy-to-buffer text-start start-point)
(funcall (mm-uu-function-extract entry))
......@@ -501,11 +504,32 @@ Return that buffer."
(re-search-forward "." nil t)))
(mm-make-handle (mm-uu-copy-to-buffer text-start (point-max))
(setq result (cons "multipart/mixed" (nreverse result))))
(defun mm-uu-dissect-text-parts (handle)
"Dissect text parts and put uu handles into HANDLE."
(let ((buffer (mm-handle-buffer handle))
type children)
(cond ((stringp buffer)
(dolist (elem (cdr handle))
(mm-uu-dissect-text-parts elem)))
((bufferp buffer)
(when (and (setq type (mm-handle-media-type handle))
(stringp type)
(string-match "\\`text/" type)
(with-current-buffer buffer
(setq children
(mm-uu-dissect t (mm-handle-type handle)))))
(kill-buffer buffer)
(setcar handle (car children))
(setcdr handle (cdr children))))
(dolist (elem handle)
(mm-uu-dissect-text-parts elem))))))
(provide 'mm-uu)
;; arch-tag: 7db076bf-53db-4320-aa19-ca76a1d2ab2c
......@@ -51,8 +51,7 @@
(defvar mm-text-html-renderer-alist
'((w3 . mm-inline-text-html-render-with-w3)
(w3m . mm-inline-text-html-render-with-w3m)
(w3m-standalone mm-inline-render-with-stdin nil
"w3m" "-dump" "-T" "text/html")
(w3m-standalone . mm-inline-text-html-render-with-w3m-standalone)
(links mm-inline-render-with-file
"links" "-dump" file)
......@@ -64,8 +63,7 @@
(defvar mm-text-html-washer-alist
'((w3 . gnus-article-wash-html-with-w3)
(w3m . gnus-article-wash-html-with-w3m)
(w3m-standalone mm-inline-wash-with-stdin nil
"w3m" "-dump" "-T" "text/html")
(w3m-standalone . gnus-article-wash-html-with-w3m-standalone)
(links mm-inline-wash-with-file
"links" "-dump" file)
......@@ -264,6 +262,30 @@
(delete-region ,(point-min-marker)
(defun mm-inline-text-html-render-with-w3m-standalone (handle)
"Render a text/html part using w3m."
(let ((source (mm-get-part handle))
(charset (mail-content-type-get (mm-handle-type handle) 'charset))
(unless (and charset
(setq cs (mm-charset-to-coding-system charset))
(not (eq cs 'ascii)))
;; The default.
(setq charset "iso-8859-1"
cs 'iso-8859-1))
(insert source)
(let ((coding-system-for-write 'binary)
(coding-system-for-read cs))
(point-min) (point-max)
"w3m" t t nil "-dump" "-T" "text/html"
"-I" charset "-O" charset))
(defun mm-links-remove-leading-blank ()
;; Delete the annoying three spaces preceding each line of links
;; output.
2006-01-15 Bill Wohler <>
* mh-e.el (mh-limit-map, mh-help-messages): Change keybinding of
mh-narrow-to-from from / f to / m; mh-narrow-to-range from / r to
/ g.
* mh-utils.el (mh-show-limit-map): Ditto.
* mh-exec.el: Require mh-acros, mh-buffers, and mh-utils for
standalone compile.
(mh-progs, mh-lib, mh-lib-progs): Move here from mh-init.el.
......@@ -2756,8 +2756,8 @@ in list."
"'" mh-narrow-to-tick
"?" mh-prefix-help
"c" mh-narrow-to-cc
"f" mh-narrow-to-from
"r" mh-narrow-to-range
"g" mh-narrow-to-range
"m" mh-narrow-to-from
"s" mh-narrow-to-subject
"t" mh-narrow-to-to
"w" mh-widen)
......@@ -2815,7 +2815,7 @@ in list."
"\n [T]hread, [/]limit, e[X]tract, [D]igest, [I]nc spools.")
(?F "[l]ist; [v]isit folder;\n"
"[n]ew messages; [']ticked messages; [s]earch; [i]ndexed search;\n"
"[n]ew messages; [']ticked messages; [s]earch;\n"
"[p]ack; [S]ort; [r]escan; [k]ill")
(?P "[p]rint message to [f]ile; old-style [l]pr printing;\n"
"Toggle printing of [C]olors, [F]aces")
......@@ -2823,7 +2823,7 @@ in list."
"[s]equences, [l]ist,\n"
"[d]elete message from sequence, [k]ill sequence")
(?T "[t]oggle, [d]elete, [o]refile thread")
(?/ "Limit to [c]c, [f]rom, [r]ange, [s]ubject, [t]o; [w]iden")
(?/ "Limit to [c]c, ran[g]e, fro[m], [s]ubject, [t]o; [w]iden")
(?X "un[s]har, [u]udecode message")
(?D "[b]urst digest")
(?K "[v]iew, [i]nline, [o]utput/save MIME part; save [a]ll parts; \n"
......@@ -1000,8 +1000,8 @@ still visible.\n")
"'" mh-show-narrow-to-tick
"?" mh-prefix-help
"c" mh-show-narrow-to-cc
"f" mh-show-narrow-to-from
"r" mh-show-narrow-to-range
"g" mh-show-narrow-to-range
"m" mh-show-narrow-to-from
"s" mh-show-narrow-to-subject
"t" mh-show-narrow-to-to
"w" mh-show-widen)
2006-01-13 Katsumi Yamaoka <>
* gnus.texi (Article Washing): Additions.
2006-01-08 Alex Schroeder <>
* pgg.texi (Caching passphrase): Rewording.
2006-01-14 Richard M. Stallman <>
* basic.texi (Inserting Text): Minor cleanup.
......@@ -8571,7 +8571,9 @@ Treat @acronym{HTML} (@code{gnus-article-wash-html}). Note that this is
usually done automatically by Gnus if the message in question has a
@code{Content-Type} header that says that the message is @acronym{HTML}.
If a prefix is given, a charset will be asked for.
If a prefix is given, a charset will be asked for. If it is a number,
the charset defined in @code{gnus-summary-show-article-charset-alist}
(@pxref{Paging the Article}) will be used.
@vindex gnus-article-wash-function
The default is to use the function specified by
......@@ -8582,12 +8584,15 @@ Customization, emacs-mime, The Emacs MIME Manual}) to convert the
can use include:
@table @code
@item W3
@item w3
Use Emacs/W3.
@item w3m
Use @uref{, emacs-w3m}.
@item w3m-standalone
Use @uref{, w3m}.
@item links
Use @uref{, Links}.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment