summaryrefslogtreecommitdiff
path: root/lisp/gnus/mm-decode.el
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <larsi@gnus.org>2011-01-11 23:32:50 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2011-01-11 23:32:50 +0000
commitc516cd6dc7cec75a4a979f85c090f7f279eef3eb (patch)
tree3a6afccf3072f9f0c2c577d395e9c64df446f53a /lisp/gnus/mm-decode.el
parentf853f59905cce4c7b2dc442ff5da1a10769730b0 (diff)
downloademacs-c516cd6dc7cec75a4a979f85c090f7f279eef3eb.tar.gz
proto-stream.el (open-protocol-stream): Protect against the low-level transport functions returning nil.
gnus-sum.el (gnus-summary-next-article): Remove hack to reselect group window, because it does the wrong thing when a separate frame displays the group buffer. gnus-int.el (gnus-request-accept-article): Don't try to update marks and stuff if the backend didn't return the article number. This fixes an Exchange-related nnimap bug. mm-decode.el (mm-preferred-alternative-precedence): Discourage showing empty parts. nnimap.el (nnimap-convert-partial-article): Protect against zero-length body parts.
Diffstat (limited to 'lisp/gnus/mm-decode.el')
-rw-r--r--lisp/gnus/mm-decode.el21
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 216ed6624d9..62755347142 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1,7 +1,7 @@
;;; mm-decode.el --- Functions for decoding MIME things
;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
@@ -1367,13 +1367,18 @@ Use CMD as the process."
(defun mm-preferred-alternative-precedence (handles)
"Return the precedence based on HANDLES and `mm-discouraged-alternatives'."
- (let ((seq (nreverse (mapcar #'mm-handle-media-type
- handles))))
- (dolist (disc (reverse mm-discouraged-alternatives))
- (dolist (elem (copy-sequence seq))
- (when (string-match disc elem)
- (setq seq (nconc (delete elem seq) (list elem))))))
- seq))
+ (setq handles (reverse handles))
+ (dolist (disc (reverse mm-discouraged-alternatives))
+ (dolist (handle (copy-sequence handles))
+ (when (string-match disc (mm-handle-media-type handle))
+ (setq handles (nconc (delete handle handles) (list handle))))))
+ ;; Remove empty parts.
+ (dolist (handle (copy-sequence handles))
+ (unless (with-current-buffer (mm-handle-buffer handle)
+ (goto-char (point-min))
+ (re-search-forward "[^ \t\n]" nil t))
+ (setq handles (nconc (delete handle handles) (list handle)))))
+ (mapcar #'mm-handle-media-type handles))
(defun mm-get-content-id (id)
"Return the handle(s) referred to by ID."