emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r102822: proto-stream.el (open-protoc


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102822: proto-stream.el (open-protocol-stream): Protect against the low-level transport functions returning nil.
Date: Tue, 11 Jan 2011 23:32:50 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102822
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Tue 2011-01-11 23:32:50 +0000
message:
  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.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-int.el
  lisp/gnus/gnus-sum.el
  lisp/gnus/mm-decode.el
  lisp/gnus/nnimap.el
  lisp/gnus/proto-stream.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-01-07 09:28:29 +0000
+++ b/lisp/gnus/ChangeLog       2011-01-11 23:32:50 +0000
@@ -1,3 +1,22 @@
+2011-01-11  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * 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  <address@hidden>
 
        * mml2015.el (epg-sub-key-fingerprint): Autoload.

=== modified file 'lisp/gnus/gnus-int.el'
--- a/lisp/gnus/gnus-int.el     2010-12-16 22:22:28 +0000
+++ b/lisp/gnus/gnus-int.el     2011-01-11 23:32:50 +0000
@@ -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 <address@hidden>
 ;; Keywords: news
@@ -711,7 +711,9 @@
          (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))
 

=== modified file 'lisp/gnus/gnus-sum.el'
--- a/lisp/gnus/gnus-sum.el     2011-01-02 11:23:02 +0000
+++ b/lisp/gnus/gnus-sum.el     2011-01-11 23:32:50 +0000
@@ -7687,9 +7687,6 @@
           (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)

=== modified file 'lisp/gnus/mm-decode.el'
--- a/lisp/gnus/mm-decode.el    2010-12-07 05:06:56 +0000
+++ b/lisp/gnus/mm-decode.el    2011-01-11 23:32:50 +0000
@@ -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 <address@hidden>
 ;;     MORIOKA Tomohiko <address@hidden>
@@ -1367,13 +1367,18 @@
 
 (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."

=== modified file 'lisp/gnus/nnimap.el'
--- a/lisp/gnus/nnimap.el       2011-01-02 23:17:32 +0000
+++ b/lisp/gnus/nnimap.el       2011-01-11 23:32:50 +0000
@@ -582,7 +582,7 @@
     ;; 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)))

=== modified file 'lisp/gnus/proto-stream.el'
--- a/lisp/gnus/proto-stream.el 2010-12-13 04:22:39 +0000
+++ b/lisp/gnus/proto-stream.el 2011-01-11 23:32:50 +0000
@@ -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 <address@hidden>
 ;; Keywords: network
@@ -101,14 +101,17 @@
       (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)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]