aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGnus developers2010-10-24 22:32:38 +0000
committerKatsumi Yamaoka2010-10-24 22:32:38 +0000
commitb5c575e640368d4a29c53d8a4f0cf2dab3355b9f (patch)
treebaa6e421e77302bec437b5f8de3ed1c45bb2facc
parent709228c0d3d2e5e810fa8194488334a267c0508f (diff)
downloademacs-b5c575e640368d4a29c53d8a4f0cf2dab3355b9f.tar.gz
emacs-b5c575e640368d4a29c53d8a4f0cf2dab3355b9f.zip
Merge changes made in Gnus trunk.
message.el (message-default-headers): Fix type. nnimap.el (nnimap-request-head, nnimap-request-move-article): Make internal nnimap moving slightly faster. nnimap.el (nnimap-transform-headers): Don't bug out on bodiless articles. nnimap.el (nnimap-send-command): Have no outstanding messages if the IMAP server doesn't support streaming. nnimap.el (nnimap-transform-headers): Fold {quoted} strings more sloppily.
-rw-r--r--doc/misc/message.texi6
-rw-r--r--lisp/gnus/ChangeLog14
-rw-r--r--lisp/gnus/gnus-int.el3
-rw-r--r--lisp/gnus/message.el13
-rw-r--r--lisp/gnus/nnimap.el64
5 files changed, 71 insertions, 29 deletions
diff --git a/doc/misc/message.texi b/doc/misc/message.texi
index 76845e4aafe..1fec34f147b 100644
--- a/doc/misc/message.texi
+++ b/doc/misc/message.texi
@@ -1450,8 +1450,10 @@ Allegedly.
1450 1450
1451@item message-default-headers 1451@item message-default-headers
1452@vindex message-default-headers 1452@vindex message-default-headers
1453This string is inserted at the end of the headers in all message 1453Header lines to be inserted in outgoing messages before you edit the
1454buffers. If set to a function, the returned results is inserted. 1454message, so you can edit or delete their lines. If set to a string, it
1455is directly inserted. If set to a function, it is called and its
1456result is inserted.
1455 1457
1456@item message-subject-re-regexp 1458@item message-subject-re-regexp
1457@vindex message-subject-re-regexp 1459@vindex message-subject-re-regexp
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 2697a1c5409..58041943c09 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,5 +1,19 @@
12010-10-24 Lars Magne Ingebrigtsen <larsi@gnus.org> 12010-10-24 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 2
3 * nnimap.el (nnimap-request-head): New function.
4 (nnimap-request-move-article): Try to be slighly faster by not
5 requesting the entire message when moving.
6 (nnimap-transform-headers): Don't bug out on bodiless articles.
7 (nnimap-send-command): Have no outstanding messages if the IMAP server
8 doesn't support streaming.
9 (nnimap-transform-headers): Fold {quoted} strings more sloppily.
10
112010-10-24 Julien Danjou <julien@danjou.info>
12
13 * message.el (message-default-headers): Fix type.
14
152010-10-24 Lars Magne Ingebrigtsen <larsi@gnus.org>
16
3 * gnus-html.el (gnus-html-prefetch-images): Decode entities before 17 * gnus-html.el (gnus-html-prefetch-images): Decode entities before
4 prefetching images. 18 prefetching images.
5 19
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index 19bcffe0049..318cdfebda2 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -655,7 +655,8 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
655 (result (funcall (gnus-get-function gnus-command-method 655 (result (funcall (gnus-get-function gnus-command-method
656 'request-move-article) 656 'request-move-article)
657 article (gnus-group-real-name group) 657 article (gnus-group-real-name group)
658 (nth 1 gnus-command-method) accept-function last move-is-internal))) 658 (nth 1 gnus-command-method) accept-function
659 last move-is-internal)))
659 (when (and result gnus-agent 660 (when (and result gnus-agent
660 (gnus-agent-method-p gnus-command-method)) 661 (gnus-agent-method-p gnus-command-method))
661 (gnus-agent-unfetch-articles group (list article))) 662 (gnus-agent-unfetch-articles group (list article)))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 49bfd4bb934..bac6ef4fac0 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1139,14 +1139,17 @@ It is a vector of the following headers:
1139 :error "All header lines must be newline terminated") 1139 :error "All header lines must be newline terminated")
1140 1140
1141(defcustom message-default-headers "" 1141(defcustom message-default-headers ""
1142 "A string containing header lines to be inserted in outgoing messages. 1142 "Header lines to be inserted in outgoing messages.
1143It is inserted before you edit the message, so you can edit or 1143This can be set to a string containing or a function returning
1144delete these lines. If set to a function, it is called and its 1144header lines to be inserted before you edit the message, so you
1145result is inserted." 1145can edit or delete these lines. If set to a function, it is
1146called and its result is inserted."
1146 :version "23.2" 1147 :version "23.2"
1147 :group 'message-headers 1148 :group 'message-headers
1148 :link '(custom-manual "(message)Message Headers") 1149 :link '(custom-manual "(message)Message Headers")
1149 :type 'message-header-lines) 1150 :type '(choice
1151 (message-header-lines :tag "String")
1152 (function :tag "Function")))
1150 1153
1151(defcustom message-default-mail-headers 1154(defcustom message-default-mail-headers
1152 ;; Ease the transition from mail-mode to message-mode. See bugs#4431, 5555. 1155 ;; Ease the transition from mail-mode to message-mode. See bugs#4431, 5555.
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 701ed1e2412..49d2d37d482 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -136,6 +136,16 @@ textual parts.")
136(defun nnimap-buffer () 136(defun nnimap-buffer ()
137 (nnimap-find-process-buffer nntp-server-buffer)) 137 (nnimap-find-process-buffer nntp-server-buffer))
138 138
139(defun nnimap-header-parameters ()
140 (format "(UID RFC822.SIZE BODYSTRUCTURE %s)"
141 (format
142 (if (nnimap-ver4-p)
143 "BODY.PEEK[HEADER.FIELDS %s]"
144 "RFC822.HEADER.LINES %s")
145 (append '(Subject From Date Message-Id
146 References In-Reply-To Xref)
147 nnmail-extra-headers))))
148
139(deffoo nnimap-retrieve-headers (articles &optional group server fetch-old) 149(deffoo nnimap-retrieve-headers (articles &optional group server fetch-old)
140 (with-current-buffer nntp-server-buffer 150 (with-current-buffer nntp-server-buffer
141 (erase-buffer) 151 (erase-buffer)
@@ -146,14 +156,7 @@ textual parts.")
146 (nnimap-send-command 156 (nnimap-send-command
147 "UID FETCH %s %s" 157 "UID FETCH %s %s"
148 (nnimap-article-ranges (gnus-compress-sequence articles)) 158 (nnimap-article-ranges (gnus-compress-sequence articles))
149 (format "(UID RFC822.SIZE BODYSTRUCTURE %s)" 159 (nnimap-header-parameters))
150 (format
151 (if (nnimap-ver4-p)
152 "BODY.PEEK[HEADER.FIELDS %s]"
153 "RFC822.HEADER.LINES %s")
154 (append '(Subject From Date Message-Id
155 References In-Reply-To Xref)
156 nnmail-extra-headers))))
157 t) 160 t)
158 (nnimap-transform-headers)) 161 (nnimap-transform-headers))
159 (insert-buffer-substring 162 (insert-buffer-substring
@@ -171,7 +174,7 @@ textual parts.")
171 (return))) 174 (return)))
172 (setq article (match-string 1)) 175 (setq article (match-string 1))
173 ;; Unfold quoted {number} strings. 176 ;; Unfold quoted {number} strings.
174 (while (re-search-forward "[^]] {\\([0-9]+\\)}\r\n" 177 (while (re-search-forward "[^]][ (]{\\([0-9]+\\)}\r\n"
175 (1+ (line-end-position)) t) 178 (1+ (line-end-position)) t)
176 (setq size (string-to-number (match-string 1))) 179 (setq size (string-to-number (match-string 1)))
177 (delete-region (+ (match-beginning 0) 2) (point)) 180 (delete-region (+ (match-beginning 0) 2) (point))
@@ -200,7 +203,8 @@ textual parts.")
200 (insert (format "Chars: %s\n" size))) 203 (insert (format "Chars: %s\n" size)))
201 (when lines 204 (when lines
202 (insert (format "Lines: %s\n" lines))) 205 (insert (format "Lines: %s\n" lines)))
203 (re-search-forward "^\r$") 206 (unless (re-search-forward "^\r$" nil t)
207 (goto-char (point-max)))
204 (delete-region (line-beginning-position) (line-end-position)) 208 (delete-region (line-beginning-position) (line-end-position))
205 (insert ".") 209 (insert ".")
206 (forward-line 1))))) 210 (forward-line 1)))))
@@ -490,12 +494,28 @@ textual parts.")
490 (nnheader-ms-strip-cr) 494 (nnheader-ms-strip-cr)
491 (cons group article))))))))) 495 (cons group article)))))))))
492 496
493(defun nnimap-get-whole-article (article) 497(deffoo nnimap-request-head (article &optional group server to-buffer)
498 (when (nnimap-possibly-change-group group server)
499 (with-current-buffer (nnimap-buffer)
500 (when (stringp article)
501 (setq article (nnimap-find-article-by-message-id group article)))
502 (nnimap-get-whole-article
503 article (format "UID FETCH %%d %s"
504 (nnimap-header-parameters)))
505 (let ((buffer (current-buffer)))
506 (with-current-buffer (or to-buffer nntp-server-buffer)
507 (erase-buffer)
508 (insert-buffer-substring buffer)
509 (nnheader-ms-strip-cr)
510 (cons group article))))))
511
512(defun nnimap-get-whole-article (article &optional command)
494 (let ((result 513 (let ((result
495 (nnimap-command 514 (nnimap-command
496 (if (nnimap-ver4-p) 515 (or command
497 "UID FETCH %d BODY.PEEK[]" 516 (if (nnimap-ver4-p)
498 "UID FETCH %d RFC822.PEEK") 517 "UID FETCH %d BODY.PEEK[]"
518 "UID FETCH %d RFC822.PEEK"))
499 article))) 519 article)))
500 ;; Check that we really got an article. 520 ;; Check that we really got an article.
501 (goto-char (point-min)) 521 (goto-char (point-min))
@@ -715,7 +735,10 @@ textual parts.")
715 &optional last internal-move-group) 735 &optional last internal-move-group)
716 (with-temp-buffer 736 (with-temp-buffer
717 (mm-disable-multibyte) 737 (mm-disable-multibyte)
718 (when (nnimap-request-article article group server (current-buffer)) 738 (when (funcall (if internal-move-group
739 'nnimap-request-head
740 'nnimap-request-article)
741 article group server (current-buffer))
719 ;; If the move is internal (on the same server), just do it the easy 742 ;; If the move is internal (on the same server), just do it the easy
720 ;; way. 743 ;; way.
721 (let ((message-id (message-field-value "message-id"))) 744 (let ((message-id (message-field-value "message-id")))
@@ -1025,12 +1048,7 @@ textual parts.")
1025 (utf7-encode group t)) 1048 (utf7-encode group t))
1026 (nnimap-send-command "UID FETCH %d:* FLAGS" start) 1049 (nnimap-send-command "UID FETCH %d:* FLAGS" start)
1027 start group command) 1050 start group command)
1028 sequences))) 1051 sequences))))
1029 ;; Some servers apparently can't have many outstanding
1030 ;; commands, so throttle them.
1031 (when (and (not nnimap-streaming)
1032 (car sequences))
1033 (nnimap-wait-for-response (caar sequences))))
1034 sequences)))) 1052 sequences))))
1035 1053
1036(deffoo nnimap-finish-retrieve-group-infos (server infos sequences) 1054(deffoo nnimap-finish-retrieve-group-infos (server infos sequences)
@@ -1408,6 +1426,10 @@ textual parts.")
1408 (if (nnimap-newlinep nnimap-object) 1426 (if (nnimap-newlinep nnimap-object)
1409 "" 1427 ""
1410 "\r")))) 1428 "\r"))))
1429 ;; Some servers apparently can't have many outstanding
1430 ;; commands, so throttle them.
1431 (unless nnimap-streaming
1432 (nnimap-wait-for-response nnimap-sequence))
1411 nnimap-sequence) 1433 nnimap-sequence)
1412 1434
1413(defun nnimap-log-command (command) 1435(defun nnimap-log-command (command)