aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2007-04-19 12:08:53 +0000
committerMiles Bader2007-04-19 12:08:53 +0000
commit6b554e88693084621601261ea4d863684f01e34a (patch)
tree201ee78ecfc3f397b3f6ab0bca56b3728465ae0b
parent5a219983766bc643b54a38cf3f5eb2305120ac6e (diff)
downloademacs-6b554e88693084621601261ea4d863684f01e34a.tar.gz
emacs-6b554e88693084621601261ea4d863684f01e34a.zip
Merge from gnus--rel--5.10
Patches applied: * gnus--rel--5.10 (patch 216) - Update from CVS 2007-04-19 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/gnus-art.el (gnus-mime-strip-charset-parameters): New function. (gnus-mime-view-part-as-charset): Use it; redisplay subpart currently displayed of multipart/alternative part if it is invoked from summary buffer. (gnus-article-part-wrapper): Select article window. * lisp/gnus/mm-view.el (mm-inline-text-html-render-with-w3m) (mm-inline-text-html-render-with-w3m-standalone) (mm-inline-render-with-function): Use mail-parse-charset by default. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-706
-rw-r--r--lisp/gnus/ChangeLog12
-rw-r--r--lisp/gnus/gnus-art.el69
-rw-r--r--lisp/gnus/mm-view.el10
3 files changed, 69 insertions, 22 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 8f094dd6537..b02dc6c2f8e 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,15 @@
12007-04-19 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-art.el (gnus-mime-strip-charset-parameters): New function.
4 (gnus-mime-view-part-as-charset): Use it; redisplay subpart currently
5 displayed of multipart/alternative part if it is invoked from summary
6 buffer.
7 (gnus-article-part-wrapper): Select article window.
8
9 * mm-view.el (mm-inline-text-html-render-with-w3m)
10 (mm-inline-text-html-render-with-w3m-standalone)
11 (mm-inline-render-with-function): Use mail-parse-charset by default.
12
12007-04-10 Katsumi Yamaoka <yamaoka@jpl.org> 132007-04-10 Katsumi Yamaoka <yamaoka@jpl.org>
2 14
3 * gnus-msg.el (gnus-inews-yank-articles): Use 15 * gnus-msg.el (gnus-inews-yank-articles): Use
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 552f3a68f49..6ae52b5eedd 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -4606,6 +4606,21 @@ are decompressed."
4606 (mm-string-to-multibyte contents))) 4606 (mm-string-to-multibyte contents)))
4607 (goto-char b))))) 4607 (goto-char b)))))
4608 4608
4609(defun gnus-mime-strip-charset-parameters (handle)
4610 "Strip charset parameters from HANDLE."
4611 (if (stringp (car handle))
4612 (mapc #'gnus-mime-strip-charset-parameters (cdr handle))
4613 (let* ((type (mm-handle-type (if (equal (mm-handle-media-type handle)
4614 "message/external-body")
4615 (progn
4616 (unless (mm-handle-cache handle)
4617 (mm-extern-cache-contents handle))
4618 (mm-handle-cache handle))
4619 handle)))
4620 (charset (assq 'charset (cdr type))))
4621 (when charset
4622 (delq charset type)))))
4623
4609(defun gnus-mime-view-part-as-charset (&optional handle arg) 4624(defun gnus-mime-view-part-as-charset (&optional handle arg)
4610 "Insert the MIME part under point into the current buffer using the 4625 "Insert the MIME part under point into the current buffer using the
4611specified charset." 4626specified charset."
@@ -4614,7 +4629,7 @@ specified charset."
4614 (let ((handle (or handle (get-text-property (point) 'gnus-data))) 4629 (let ((handle (or handle (get-text-property (point) 'gnus-data)))
4615 (fun (get-text-property (point) 'gnus-callback)) 4630 (fun (get-text-property (point) 'gnus-callback))
4616 (gnus-newsgroup-ignored-charsets 'gnus-all) 4631 (gnus-newsgroup-ignored-charsets 'gnus-all)
4617 gnus-newsgroup-charset type charset) 4632 gnus-newsgroup-charset form preferred parts)
4618 (when handle 4633 (when handle
4619 (if (mm-handle-undisplayer handle) 4634 (if (mm-handle-undisplayer handle)
4620 (mm-remove-part handle)) 4635 (mm-remove-part handle))
@@ -4622,17 +4637,24 @@ specified charset."
4622 (setq gnus-newsgroup-charset 4637 (setq gnus-newsgroup-charset
4623 (or (cdr (assq arg gnus-summary-show-article-charset-alist)) 4638 (or (cdr (assq arg gnus-summary-show-article-charset-alist))
4624 (mm-read-coding-system "Charset: "))) 4639 (mm-read-coding-system "Charset: ")))
4625 ;; Strip the charset parameter from `handle'. 4640 (gnus-mime-strip-charset-parameters handle)
4626 (setq type (mm-handle-type 4641 (when (and (consp (setq form (cdr-safe fun)))
4627 (if (equal (mm-handle-media-type handle) 4642 (setq form (ignore-errors
4628 "message/external-body") 4643 (assq 'gnus-mime-display-alternative form)))
4629 (progn 4644 (setq preferred (caddr form))
4630 (unless (mm-handle-cache handle) 4645 (progn
4631 (mm-extern-cache-contents handle)) 4646 (when (eq (car preferred) 'quote)
4632 (mm-handle-cache handle)) 4647 (setq preferred (cadr preferred)))
4633 handle)) 4648 (not (equal preferred
4634 charset (assq 'charset (cdr type))) 4649 (get-text-property (point) 'gnus-data))))
4635 (delq charset type) 4650 (setq parts (get-text-property (point) 'gnus-part))
4651 (setq parts (cdr (assq parts
4652 gnus-article-mime-handle-alist)))
4653 (equal (mm-handle-media-type parts) "multipart/alternative")
4654 (setq parts (reverse (cdr parts))))
4655 (setcar (cddr form)
4656 (list 'quote (or (cadr (member preferred parts))
4657 (car parts)))))
4636 (funcall fun handle))))) 4658 (funcall fun handle)))))
4637 4659
4638(defun gnus-mime-view-part-externally (&optional handle) 4660(defun gnus-mime-view-part-externally (&optional handle)
@@ -4688,13 +4710,22 @@ If no internal viewer is available, use an external viewer."
4688 (funcall (cdr action-pair))))) 4710 (funcall (cdr action-pair)))))
4689 4711
4690(defun gnus-article-part-wrapper (n function) 4712(defun gnus-article-part-wrapper (n function)
4691 (save-current-buffer 4713 (let ((window (get-buffer-window gnus-article-buffer 'visible))
4692 (set-buffer gnus-article-buffer) 4714 frame)
4693 (when (> n (length gnus-article-mime-handle-alist)) 4715 (when window
4694 (error "No such part")) 4716 ;; It is necessary to select the article window so that
4695 (gnus-article-goto-part n) 4717 ;; `gnus-article-goto-part' may really move the point.
4696 (let ((handle (cdr (assq n gnus-article-mime-handle-alist)))) 4718 (setq frame (selected-frame))
4697 (funcall function handle)))) 4719 (gnus-select-frame-set-input-focus (window-frame window))
4720 (unwind-protect
4721 (save-window-excursion
4722 (select-window window)
4723 (when (> n (length gnus-article-mime-handle-alist))
4724 (error "No such part"))
4725 (gnus-article-goto-part n)
4726 (let ((handle (cdr (assq n gnus-article-mime-handle-alist))))
4727 (funcall function handle)))
4728 (gnus-select-frame-set-input-focus frame)))))
4698 4729
4699(defun gnus-article-pipe-part (n) 4730(defun gnus-article-pipe-part (n)
4700 "Pipe MIME part N, which is the numerical prefix." 4731 "Pipe MIME part N, which is the numerical prefix."
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 14d480fe7df..888c814bf24 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -238,7 +238,8 @@
238 (mm-setup-w3m) 238 (mm-setup-w3m)
239 (let ((text (mm-get-part handle)) 239 (let ((text (mm-get-part handle))
240 (b (point)) 240 (b (point))
241 (charset (mail-content-type-get (mm-handle-type handle) 'charset))) 241 (charset (or (mail-content-type-get (mm-handle-type handle) 'charset)
242 mail-parse-charset)))
242 (save-excursion 243 (save-excursion
243 (insert (if charset (mm-decode-string text charset) text)) 244 (insert (if charset (mm-decode-string text charset) text))
244 (save-restriction 245 (save-restriction
@@ -302,7 +303,9 @@
302 "Render a text/html part using w3m." 303 "Render a text/html part using w3m."
303 (if (mm-w3m-standalone-supports-m17n-p) 304 (if (mm-w3m-standalone-supports-m17n-p)
304 (let ((source (mm-get-part handle)) 305 (let ((source (mm-get-part handle))
305 (charset (mail-content-type-get (mm-handle-type handle) 'charset)) 306 (charset (or (mail-content-type-get (mm-handle-type handle)
307 'charset)
308 (symbol-name mail-parse-charset)))
306 cs) 309 cs)
307 (unless (and charset 310 (unless (and charset
308 (setq cs (mm-charset-to-coding-system charset)) 311 (setq cs (mm-charset-to-coding-system charset))
@@ -368,7 +371,8 @@
368 371
369(defun mm-inline-render-with-function (handle func &rest args) 372(defun mm-inline-render-with-function (handle func &rest args)
370 (let ((source (mm-get-part handle)) 373 (let ((source (mm-get-part handle))
371 (charset (mail-content-type-get (mm-handle-type handle) 'charset))) 374 (charset (or (mail-content-type-get (mm-handle-type handle) 'charset)
375 mail-parse-charset)))
372 (mm-insert-inline 376 (mm-insert-inline
373 handle 377 handle
374 (mm-with-multibyte-buffer 378 (mm-with-multibyte-buffer