summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog19
-rw-r--r--lisp/gnus/gnus-int.el6
-rw-r--r--lisp/gnus/gnus-sum.el3
-rw-r--r--lisp/gnus/mm-decode.el21
-rw-r--r--lisp/gnus/nnimap.el2
-rw-r--r--lisp/gnus/proto-stream.el21
6 files changed, 49 insertions, 23 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index abbddcc49cc..c0c6533d531 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,22 @@
+2011-01-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * nnimap.el (nnimap-convert-partial-article): Protect against
+ zero-length body parts.
+
+ * mm-decode.el (mm-preferred-alternative-precedence): Discourage
+ showing empty parts.
+
+ * 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.
+
+ * 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.
+
+ * proto-stream.el (open-protocol-stream): Protect against the low-level
+ transport functions returning nil.
+
2011-01-07 Daiki Ueno <ueno@unixuser.org>
* mml2015.el (epg-sub-key-fingerprint): Autoload.
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index 71a9aa9e618..b805167149f 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -1,7 +1,7 @@
;;; gnus-int.el --- backend interface functions for Gnus
;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news
@@ -711,7 +711,9 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
(if (stringp group) (gnus-group-real-name group) group)
(cadr gnus-command-method)
last)))
- (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
+ (when (and gnus-agent
+ (gnus-agent-method-p gnus-command-method)
+ (cdr result))
(gnus-agent-regenerate-group group (list (cdr result))))
result))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 9a21a9c7f68..20a1141cc25 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -7687,9 +7687,6 @@ If BACKWARD, the previous article is selected instead of the next."
(if (eq gnus-keep-same-level 'best)
(gnus-summary-best-group gnus-newsgroup-name)
(gnus-summary-search-group backward gnus-keep-same-level))))
- ;; For some reason, the group window gets selected. We change
- ;; it back.
- (select-window (get-buffer-window (current-buffer)))
;; Select next unread newsgroup automagically.
(cond
((or (not gnus-auto-select-next)
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."
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 51fa532a371..0c711701e96 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -582,7 +582,7 @@ textual parts.")
;; Collect all the body parts.
(while (looking-at ".*BODY\\[\\([.0-9]+\\)\\]")
(setq id (match-string 1)
- bytes (nnimap-get-length))
+ bytes (or (nnimap-get-length) 0))
(beginning-of-line)
(delete-region (point) (progn (forward-line 1) (point)))
(push (list id (buffer-substring (point) (+ (point) bytes)))
diff --git a/lisp/gnus/proto-stream.el b/lisp/gnus/proto-stream.el
index d1266cb5461..546461a67b3 100644
--- a/lisp/gnus/proto-stream.el
+++ b/lisp/gnus/proto-stream.el
@@ -1,6 +1,6 @@
;;; proto-stream.el --- negotiating TLS, STARTTLS and other connections
-;; Copyright (C) 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: network
@@ -101,14 +101,17 @@ command to switch on STARTTLS otherwise."
(setq type 'network))
((eq type 'ssl)
(setq type 'tls)))
- (destructuring-bind (stream greeting capabilities)
- (funcall (intern (format "proto-stream-open-%s" type) obarray)
- name buffer host service parameters)
- (list (and stream
- (memq (process-status stream)
- '(open run))
- stream)
- greeting capabilities))))
+ (let ((open-result
+ (funcall (intern (format "proto-stream-open-%s" type) obarray)
+ name buffer host service parameters)))
+ (if (null open-result)
+ (list nil nil nil)
+ (destructuring-bind (stream greeting capabilities) open-result
+ (list (and stream
+ (memq (process-status stream)
+ '(open run))
+ stream)
+ greeting capabilities))))))
(defun proto-stream-open-network-only (name buffer host service parameters)
(let ((start (with-current-buffer buffer (point)))