aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGnus developers2011-05-01 23:30:18 +0000
committerKatsumi Yamaoka2011-05-01 23:30:18 +0000
commitb87f32fc00c8b085e575fdd4f04af716eee599c4 (patch)
tree037e653c0dcb425e3b340dee9a255211df98a79b
parent8de66e05c4b7de58d7bd091bda5674b2677fb6ad (diff)
downloademacs-b87f32fc00c8b085e575fdd4f04af716eee599c4.tar.gz
emacs-b87f32fc00c8b085e575fdd4f04af716eee599c4.zip
Merge changes made in Gnus trunk.
pop3.el (pop3-open-server): Upgrade opportunistically to STARTTLS. (open-tls-stream): Remove superfluous tls/starttls autoloads. gnus-sum.el (gnus-summary-next-article): Don't bug out if the summary buffer has moved to a different frame. nnimap.el (nnimap-request-article): Use nntp-insert-buffer-substring to get the conversion from unibyte to multibyte buffers to work on Emacs 22. nntp.el (nntp-request-article): Slight clean-up.
-rw-r--r--lisp/gnus/ChangeLog18
-rw-r--r--lisp/gnus/gnus-sum.el3
-rw-r--r--lisp/gnus/nnimap.el7
-rw-r--r--lisp/gnus/nntp.el13
-rw-r--r--lisp/gnus/pop3.el90
5 files changed, 62 insertions, 69 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index a4327337f87..e933a80199d 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,21 @@
12011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * pop3.el (pop3-open-server): Upgrade opportunistically to STARTTLS.
4 (open-tls-stream): Remove superfluous tls/starttls autoloads.
5
62011-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 * gnus-sum.el (gnus-summary-next-article): Don't bug out if the summary
9 buffer has moved to a different frame.
10
112011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
12
13 * nnimap.el (nnimap-request-article): Use nntp-insert-buffer-substring
14 to get the conversion from unibyte to multibyte buffers to work on
15 Emacs 22.
16
17 * nntp.el (nntp-request-article): Slight clean-up.
18
12011-04-29 Lars Magne Ingebrigtsen <larsi@gnus.org> 192011-04-29 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 20
3 * shr.el (shr-strike-through): New face. 21 * shr.el (shr-strike-through): New face.
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 807f133e481..3cbb479e068 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -7783,7 +7783,8 @@ If BACKWARD, the previous article is selected instead of the next."
7783 ;; Somehow or other, we may now have selected a different 7783 ;; Somehow or other, we may now have selected a different
7784 ;; window. Make point go back to the summary buffer. 7784 ;; window. Make point go back to the summary buffer.
7785 (when (eq current-summary (current-buffer)) 7785 (when (eq current-summary (current-buffer))
7786 (select-window (get-buffer-window current-summary))) 7786 ;; FIXME: This burps when get-buffer-window returns nil.
7787 (select-window (get-buffer-window current-summary 0)))
7787 (gnus-summary-walk-group-buffer 7788 (gnus-summary-walk-group-buffer
7788 gnus-newsgroup-name cmd unread backward point)))))))) 7789 gnus-newsgroup-name cmd unread backward point))))))))
7789 7790
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index f819c17afe8..681d483b462 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -545,10 +545,9 @@ textual parts.")
545 (nnimap-get-whole-article article)) 545 (nnimap-get-whole-article article))
546 (let ((buffer (current-buffer))) 546 (let ((buffer (current-buffer)))
547 (with-current-buffer (or to-buffer nntp-server-buffer) 547 (with-current-buffer (or to-buffer nntp-server-buffer)
548 (erase-buffer) 548 (nntp-insert-buffer-substring buffer)
549 (insert-buffer-substring buffer) 549 (nnheader-ms-strip-cr)))
550 (nnheader-ms-strip-cr) 550 (cons group article)))))))
551 (cons group article)))))))))
552 551
553(deffoo nnimap-request-head (article &optional group server to-buffer) 552(deffoo nnimap-request-head (article &optional group server to-buffer)
554 (when (nnimap-possibly-change-group group server) 553 (when (nnimap-possibly-change-group group server)
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 3285da513e8..c8f1d04d4d3 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -1028,16 +1028,15 @@ command whose response triggered the error."
1028 1028
1029(deffoo nntp-request-article (article &optional group server buffer command) 1029(deffoo nntp-request-article (article &optional group server buffer command)
1030 (nntp-with-open-group 1030 (nntp-with-open-group
1031 group server 1031 group server
1032 (when (nntp-send-command-and-decode 1032 (when (nntp-send-command-and-decode
1033 "\r?\n\\.\r?\n" "ARTICLE" 1033 "\r?\n\\.\r?\n" "ARTICLE"
1034 (if (numberp article) (int-to-string article) article)) 1034 (if (numberp article) (int-to-string article) article))
1035 (if (and buffer 1035 (when (and buffer
1036 (not (equal buffer nntp-server-buffer))) 1036 (not (equal buffer nntp-server-buffer)))
1037 (with-current-buffer nntp-server-buffer 1037 (with-current-buffer nntp-server-buffer
1038 (copy-to-buffer buffer (point-min) (point-max)) 1038 (copy-to-buffer buffer (point-min) (point-max))))
1039 (nntp-find-group-and-number group)) 1039 (nntp-find-group-and-number group))))
1040 (nntp-find-group-and-number group)))))
1041 1040
1042(deffoo nntp-request-head (article &optional group server) 1041(deffoo nntp-request-head (article &optional group server)
1043 (nntp-with-open-group 1042 (nntp-with-open-group
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el
index 08cd7cd4ef1..3ca5cab76e1 100644
--- a/lisp/gnus/pop3.el
+++ b/lisp/gnus/pop3.el
@@ -33,6 +33,13 @@
33;;; Code: 33;;; Code:
34 34
35(eval-when-compile (require 'cl)) 35(eval-when-compile (require 'cl))
36
37(eval-and-compile
38 ;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for
39 ;; `make-network-stream'.
40 (unless (fboundp 'open-protocol-stream)
41 (require 'proto-stream)))
42
36(require 'mail-utils) 43(require 'mail-utils)
37(defvar parse-time-months) 44(defvar parse-time-months)
38 45
@@ -257,10 +264,6 @@ Use streaming commands."
257 (pop3-quit process) 264 (pop3-quit process)
258 message-count)) 265 message-count))
259 266
260(autoload 'open-tls-stream "tls")
261(autoload 'starttls-open-stream "starttls")
262(autoload 'starttls-negotiate "starttls") ; avoid warning
263
264(defcustom pop3-stream-type nil 267(defcustom pop3-stream-type nil
265 "*Transport security type for POP3 connexions. 268 "*Transport security type for POP3 connexions.
266This may be either nil (plain connexion), `ssl' (use an 269This may be either nil (plain connexion), `ssl' (use an
@@ -286,64 +289,37 @@ this is nil, `ssl' is assumed for connexions to port
286Returns the process associated with the connection." 289Returns the process associated with the connection."
287 (let ((coding-system-for-read 'binary) 290 (let ((coding-system-for-read 'binary)
288 (coding-system-for-write 'binary) 291 (coding-system-for-write 'binary)
289 process) 292 result)
290 (with-current-buffer 293 (with-current-buffer
291 (get-buffer-create (concat " trace of POP session to " 294 (get-buffer-create (concat " trace of POP session to "
292 mailhost)) 295 mailhost))
293 (erase-buffer) 296 (erase-buffer)
294 (setq pop3-read-point (point-min)) 297 (setq pop3-read-point (point-min))
295 (setq process 298 (setq result
296 (cond 299 (open-protocol-stream
297 ((or (eq pop3-stream-type 'ssl) 300 "POP" (current-buffer) mailhost port
298 (and (not pop3-stream-type) (member port '(995 "pop3s")))) 301 :type (cond
299 ;; gnutls-cli, openssl don't accept service names 302 ((or (eq pop3-stream-type 'ssl)
300 (if (or (equal port "pop3s") 303 (and (not pop3-stream-type)
301 (null port)) 304 (member port '(995 "pop3s"))))
302 (setq port 995)) 305 :tls)
303 (let ((process (open-tls-stream "POP" (current-buffer) 306 (t
304 mailhost port))) 307 (or pop3-stream-type 'network)))
305 (when process 308 :capability-command "CAPA\r\n"
306 ;; There's a load of info printed that needs deleting. 309 :end-of-command "^\\.\r?\n\\|^\\+[A-Z]+ .*\n"
307 (let ((again 't)) 310 :success "^\\+OK.*\n"
308 ;; repeat until 311 :return-list t
309 ;; - either we received the +OK line 312 :starttls-function
310 ;; - or accept-process-output timed out without getting 313 (lambda (capabilities)
311 ;; anything 314 (and (string-match "\\bSTLS\\b" capabilities)
312 (while (and again 315 "STLS\r\n"))))
313 (setq again (memq (process-status process) 316 (when result
314 '(open run)))) 317 (let ((response (plist-get (cdr result) :greeting)))
315 (setq again (pop3-accept-process-output process)) 318 (setq pop3-timestamp
316 (goto-char (point-max)) 319 (substring response (or (string-match "<" response) 0)
317 (forward-line -1) 320 (+ 1 (or (string-match ">" response) -1)))))
318 (cond ((looking-at "\\+OK") 321 (pop3-set-process-query-on-exit-flag (car result) nil)
319 (setq again nil) 322 (car result)))))
320 (delete-region (point-min) (point)))
321 ((not again)
322 (pop3-quit process)
323 (error "POP SSL connexion failed")))))
324 process)))
325 ((eq pop3-stream-type 'starttls)
326 ;; gnutls-cli, openssl don't accept service names
327 (if (equal port "pop3")
328 (setq port 110))
329 ;; Delay STLS until server greeting is read (Bug#7438).
330 (starttls-open-stream "POP" (current-buffer)
331 mailhost (or port 110)))
332 (t
333 (open-network-stream "POP" (current-buffer) mailhost port))))
334 (let ((response (pop3-read-response process t)))
335 (setq pop3-timestamp
336 (substring response (or (string-match "<" response) 0)
337 (+ 1 (or (string-match ">" response) -1)))))
338 (when (eq pop3-stream-type 'starttls)
339 (pop3-send-command process "STLS")
340 (let ((response (pop3-read-response process t)))
341 (if (and response (string-match "+OK" response))
342 (starttls-negotiate process)
343 (pop3-quit process)
344 (error "POP server doesn't support starttls"))))
345 (pop3-set-process-query-on-exit-flag process nil)
346 process)))
347 323
348;; Support functions 324;; Support functions
349 325