aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2010-09-20 00:36:54 +0000
committerKatsumi Yamaoka2010-09-20 00:36:54 +0000
commitbdaa75c74db6a3193515985146eaee5e9caa7ed0 (patch)
tree4db0906c689fbedefc34a72148056ffb2e4364f5
parent596880ea94f64b783cb3f97be611281924b7028b (diff)
downloademacs-bdaa75c74db6a3193515985146eaee5e9caa7ed0.tar.gz
emacs-bdaa75c74db6a3193515985146eaee5e9caa7ed0.zip
Merge changes made in Gnus trunk.
mail-parse.el (mail-header-encode-parameter): Define as rfc2045-encode-string. nnheader.el (nnheader-insert-nov): Protect against junk appearing in the extra mail headers. gnus-html.el: Prefetch and html washing additions. gnus-html.el (gnus-html-prefetch-images): Fix up the url-retrieve calling conventions so that prefetch doesn't bug out. Pass proper format strings to gnus-message. nnimap.el: Allow anonymous login. nnimap.el (nnimap-transform-headers): The chars header is called Chars not Bytes. nnimap.el (nnimap-wait-for-response): Don't infloop if the IMAP connection drops. gnus-start.el (gnus-get-unread-articles): Call `gnus-open-server' on each method before trying to scan them etc. gnus-sum.el (gnus-summary-update-mark): Replace subst-char-in-region by subst-char-in-region. gnus.el (gnus-similar-server-opened): Refactor a bit and add comments. gnus.el: Fix a speed regression based in methods that were similar weren't the same. gnus.el (gnus): When using the development version of Gnus, load the gnus-load file. nnimap.el (nnimap-open-connection): When looking for credentials, also use the nnimap-server-port. nnimap.el (nnimap-request-article): Return the group/article number, so that Gnus `^' works as expected. nnimap.el (nnimap-find-wanted-parts-1): Return the MIME parts as IMAP wants them. gnus-start.el (gnus-ignored-newsgroups): Remove [] from the list of bogus characters. gnus-html.el (gnus-html-image-fetched): Protect against the data not arriving. nnimap.el (nnimap-wait-for-connection): Avoid a race condition while waiting for the connection string. gnus.texi (Required Back End Functions): Document INFO.
-rw-r--r--doc/misc/gnus.texi5
-rw-r--r--lisp/gnus/ChangeLog87
-rw-r--r--lisp/gnus/gnus-agent.el6
-rw-r--r--lisp/gnus/gnus-art.el2
-rw-r--r--lisp/gnus/gnus-group.el14
-rw-r--r--lisp/gnus/gnus-html.el94
-rw-r--r--lisp/gnus/gnus-int.el5
-rw-r--r--lisp/gnus/gnus-score.el10
-rw-r--r--lisp/gnus/gnus-srvr.el2
-rw-r--r--lisp/gnus/gnus-start.el24
-rw-r--r--lisp/gnus/gnus-sum.el8
-rw-r--r--lisp/gnus/gnus.el57
-rw-r--r--lisp/gnus/mail-parse.el3
-rw-r--r--lisp/gnus/nnheader.el2
-rw-r--r--lisp/gnus/nnimap.el84
15 files changed, 306 insertions, 97 deletions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 7248897f05b..c4bccdc30a1 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -29672,7 +29672,7 @@ group and article numbers are when fetching articles by
29672on successful article retrieval. 29672on successful article retrieval.
29673 29673
29674 29674
29675@item (nnchoke-request-group GROUP &optional SERVER FAST) 29675@item (nnchoke-request-group GROUP &optional SERVER FAST INFO)
29676 29676
29677Get data on @var{group}. This function also has the side effect of 29677Get data on @var{group}. This function also has the side effect of
29678making @var{group} the current group. 29678making @var{group} the current group.
@@ -29680,6 +29680,9 @@ making @var{group} the current group.
29680If @var{fast}, don't bother to return useful data, just make @var{group} 29680If @var{fast}, don't bother to return useful data, just make @var{group}
29681the current group. 29681the current group.
29682 29682
29683If @var{info}, it allows the backend to update the group info
29684structure.
29685
29683Here's an example of some result data and a definition of the same: 29686Here's an example of some result data and a definition of the same:
29684 29687
29685@example 29688@example
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index e652d5462a2..4117a85ad8d 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,5 +1,90 @@
12010-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org> 12010-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 2
3 * nnimap.el (nnimap-wait-for-connection): Avoid a race condition while
4 waiting for the connection string.
5
6 * gnus-html.el (gnus-html-image-fetched): Protect against the data not
7 arriving.
8
9 * gnus-start.el (gnus-ignored-newsgroups): Remove [] from the list of
10 bogus characters. This allows selecting certain Gmail groups.
11
12 * nnimap.el (nnimap-find-wanted-parts-1): New function.
13 (nnimap-fetch-partial-articles): New variable.
14 (nnimap-open-connection): When looking for credentials, also use the
15 nnimap-server-port.
16 (nnimap-request-article): Return the group/article number, so that Gnus
17 `^' works as expected.
18 (nnimap-find-wanted-parts-1): Return the MIME parts as IMAP wants
19 them.
20
21 * gnus.el (gnus-similar-server-opened): Refactor a bit and add
22 comments.
23 (gnus-methods-sloppily-equal): New function.
24 (gnus): When using the development version of Gnus, load the gnus-load
25 file.
26
27 * gnus-start.el (gnus-get-unread-articles): Make sure that we call
28 `gnus-open-server' on each method before trying to scan them etc. This
29 ensures that all the backend parameters are set correctly.
30
31 * nnimap.el (nnimap-authenticator): New variable.
32 (nnimap-open-connection): Allow anonymous login.
33 (nnimap-transform-headers): The chars header is called Chars not
34 Bytes.
35 (nnimap-wait-for-response): Don't infloop if the IMAP connection
36 drops.
37
38 * gnus-art.el (gnus-article-describe-briefly): Fix up typo in last
39 patch, found by Knut Anders Hatlen.
40
412010-09-19 Andreas Schwab <schwab@linux-m68k.org>
42
43 * gnus-agent.el (gnus-agent-batch-confirmation)
44 (gnus-agent-expire-group, gnus-agent-expire): Pass proper format string
45 to gnus-message.
46 * gnus-art.el (gnus-article-describe-briefly): Likewise.
47 * gnus-group.el (gnus-group-list-groups, gnus-group-describe-group)
48 (gnus-group-edit-global-kill, gnus-group-describe-briefly): Likewise.
49 * gnus-int.el (gnus-open-server): Likewise.
50 * gnus-score.el (gnus-score-edit-current-scores, gnus-score-edit-file)
51 (gnus-score-check-syntax): Likewise.
52 * gnus-srvr.el (gnus-browse-describe-briefly): Likewise.
53 * gnus-start.el (gnus-read-active-file-1, gnus-read-active-file-1):
54 Likewise.
55 * gnus-sum.el (gnus-summary-describe-briefly): Likewise.
56
572010-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
58
59 * gnus-html.el (gnus-html-prefetch-images): Fix up the url-retrieve
60 calling conventions so that prefetch doesn't bug out.
61
622010-09-19 Julien Danjou <julien@danjou.info>
63
64 * gnus-sum.el (gnus-summary-update-mark): Use `subst-char-in-string'
65 rather than `subst-char-in-region' in order to be able to replace ASCII
66 char by UTF-8 ones.
67
68 * gnus-html.el (gnus-html-prefetch-images): Use `url-retrieve' rather
69 than curl.
70 (gnus-html-image-fetched): Fix `gnus-html-put-image' call not setting
71 the right URL and ALT text on images.
72 (gnus-html-wash-tags): Fix tag case.
73 Add support for `s' and `ins' tags. Use gnus-emphasis-* faces.
74 (gnus-article-html): Add -o display_ins_del=2 option.
75 (gnus-html-wash-tags): Add better support for <ul> tags symbols.
76
772010-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
78
79 * nnheader.el (nnheader-insert-nov): Protect against junk appearing in
80 the extra mail headers, which sometimes seem to happen for unknown
81 reasons.
82
83 * mail-parse.el (mail-header-encode-parameter): Define as
84 rfc2045-encode-string instead of as rfc2231-encode-string, since some
85 (or most, perhaps?) mail readers don't understand the latter, but do
86 understand the former.
87
3 * gnus-agent.el (gnus-agent-auto-agentize-methods): Switch the default 88 * gnus-agent.el (gnus-agent-auto-agentize-methods): Switch the default
4 to nil, so that no methods are automatically agentized. I think this 89 to nil, so that no methods are automatically agentized. I think this
5 is probably what most users want. 90 is probably what most users want.
@@ -41,7 +126,7 @@
41 the range update right. 126 the range update right.
42 (nnimap-request-group): Don't make `M-g' bug out on group with no 127 (nnimap-request-group): Don't make `M-g' bug out on group with no
43 marks. 128 marks.
44 (nnoo): Require, so that other packages can require nnimap. 129 (nnoo): Required, so that other packages can require nnimap.
45 (nnimap-wait-for-response): Be a bit more lax in finding the end of the 130 (nnimap-wait-for-response): Be a bit more lax in finding the end of the
46 command we're looking for. This helps when the server sends more 131 command we're looking for. This helps when the server sends more
47 responses after we've gotten everything we expected. 132 responses after we've gotten everything we expected.
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 781ea3b1a53..2a586e627c6 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -2377,7 +2377,7 @@ modified) original contents, they are first saved to their own file."
2377 2377
2378(defun gnus-agent-batch-confirmation (msg) 2378(defun gnus-agent-batch-confirmation (msg)
2379 "Show error message and return t." 2379 "Show error message and return t."
2380 (gnus-message 1 msg) 2380 (gnus-message 1 "%s" msg)
2381 t) 2381 t)
2382 2382
2383;;;###autoload 2383;;;###autoload
@@ -3123,7 +3123,7 @@ FORCE is equivalent to setting the expiration predicates to true."
3123 group overview (gnus-gethash-safe group orig) 3123 group overview (gnus-gethash-safe group orig)
3124 articles force)))) 3124 articles force))))
3125 (kill-buffer overview)))) 3125 (kill-buffer overview))))
3126 (gnus-message 4 (gnus-agent-expire-done-message))))) 3126 (gnus-message 4 "%s" (gnus-agent-expire-done-message)))))
3127 3127
3128(defun gnus-agent-expire-group-1 (group overview active articles force) 3128(defun gnus-agent-expire-group-1 (group overview active articles force)
3129 ;; Internal function - requires caller to have set 3129 ;; Internal function - requires caller to have set
@@ -3548,7 +3548,7 @@ articles in every agentized group? "))
3548 expiring-group overview active articles force)))))))) 3548 expiring-group overview active articles force))))))))
3549 (kill-buffer overview)) 3549 (kill-buffer overview))
3550 (gnus-agent-expire-unagentized-dirs) 3550 (gnus-agent-expire-unagentized-dirs)
3551 (gnus-message 4 (gnus-agent-expire-done-message)))))) 3551 (gnus-message 4 "%s" (gnus-agent-expire-done-message))))))
3552 3552
3553(defun gnus-agent-expire-done-message () 3553(defun gnus-agent-expire-done-message ()
3554 (if (and (> gnus-verbose 4) 3554 (if (and (> gnus-verbose 4)
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index bfdb9bd6b63..7e51abb564e 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -6406,7 +6406,7 @@ not have a face in `gnus-article-boring-faces'."
6406(defun gnus-article-describe-briefly () 6406(defun gnus-article-describe-briefly ()
6407 "Describe article mode commands briefly." 6407 "Describe article mode commands briefly."
6408 (interactive) 6408 (interactive)
6409 (gnus-message 6 (substitute-command-keys "\\<gnus-article-mode-map>\\[gnus-article-goto-next-page]:Next page \\[gnus-article-goto-prev-page]:Prev page \\[gnus-article-show-summary]:Show summary \\[gnus-info-find-node]:Run Info \\[gnus-article-describe-briefly]:This help"))) 6409 (gnus-message 6 "%s" (substitute-command-keys "\\<gnus-article-mode-map>\\[gnus-article-goto-next-page]:Next page \\[gnus-article-goto-prev-page]:Prev page \\[gnus-article-show-summary]:Show summary \\[gnus-info-find-node]:Run Info \\[gnus-article-describe-briefly]:This help")))
6410 6410
6411(defun gnus-article-check-buffer () 6411(defun gnus-article-check-buffer ()
6412 "Beep if not in an article buffer." 6412 "Beep if not in an article buffer."
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 5cc4ef68bd9..fa6ae51886c 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1273,7 +1273,7 @@ Also see the `gnus-group-use-permanent-levels' variable."
1273 (zerop number)) 1273 (zerop number))
1274 (zerop (buffer-size))) 1274 (zerop (buffer-size)))
1275 ;; No groups in the buffer. 1275 ;; No groups in the buffer.
1276 (gnus-message 5 gnus-no-groups-message)) 1276 (gnus-message 5 "%s" gnus-no-groups-message))
1277 ;; We have some groups displayed. 1277 ;; We have some groups displayed.
1278 (goto-char (point-max)) 1278 (goto-char (point-max))
1279 (when (or (not gnus-group-goto-next-group-function) 1279 (when (or (not gnus-group-goto-next-group-function)
@@ -4136,7 +4136,7 @@ If given a prefix argument, prompt for a group."
4136 (gnus-gethash mname gnus-description-hashtb)) 4136 (gnus-gethash mname gnus-description-hashtb))
4137 (setq desc (gnus-group-get-description group)) 4137 (setq desc (gnus-group-get-description group))
4138 (gnus-read-descriptions-file method)) 4138 (gnus-read-descriptions-file method))
4139 (gnus-message 1 4139 (gnus-message 1 "%s"
4140 (or desc (gnus-gethash group gnus-description-hashtb) 4140 (or desc (gnus-gethash group gnus-description-hashtb)
4141 "No description available"))))) 4141 "No description available")))))
4142 4142
@@ -4297,11 +4297,9 @@ If GROUP, edit that local kill file instead."
4297 (interactive "P") 4297 (interactive "P")
4298 (setq gnus-current-kill-article article) 4298 (setq gnus-current-kill-article article)
4299 (gnus-kill-file-edit-file group) 4299 (gnus-kill-file-edit-file group)
4300 (gnus-message 4300 (gnus-message 6 "Editing a %s kill file (Type %s to exit)"
4301 6 4301 (if group "local" "global")
4302 (substitute-command-keys 4302 (substitute-command-keys "\\[gnus-kill-file-exit]")))
4303 (format "Editing a %s kill file (Type \\[gnus-kill-file-exit] to exit)"
4304 (if group "local" "global")))))
4305 4303
4306(defun gnus-group-edit-local-kill (article group) 4304(defun gnus-group-edit-local-kill (article group)
4307 "Edit a local kill file." 4305 "Edit a local kill file."
@@ -4392,7 +4390,7 @@ The hook `gnus-exit-gnus-hook' is called before actually exiting."
4392(defun gnus-group-describe-briefly () 4390(defun gnus-group-describe-briefly ()
4393 "Give a one line description of the group mode commands." 4391 "Give a one line description of the group mode commands."
4394 (interactive) 4392 (interactive)
4395 (gnus-message 7 (substitute-command-keys "\\<gnus-group-mode-map>\\[gnus-group-read-group]:Select \\[gnus-group-next-unread-group]:Forward \\[gnus-group-prev-unread-group]:Backward \\[gnus-group-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-group-describe-briefly]:This help"))) 4393 (gnus-message 7 "%s" (substitute-command-keys "\\<gnus-group-mode-map>\\[gnus-group-read-group]:Select \\[gnus-group-next-unread-group]:Forward \\[gnus-group-prev-unread-group]:Backward \\[gnus-group-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-group-describe-briefly]:This help")))
4396 4394
4397(defun gnus-group-browse-foreign-server (method) 4395(defun gnus-group-browse-foreign-server (method)
4398 "Browse a foreign news server. 4396 "Browse a foreign news server.
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index d3e8c48f440..819a6d6f31a 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -114,6 +114,7 @@ fit these criteria."
114 "-I" "UTF-8" 114 "-I" "UTF-8"
115 "-O" "UTF-8" 115 "-O" "UTF-8"
116 "-o" "ext_halfdump=1" 116 "-o" "ext_halfdump=1"
117 "-o" "display_ins_del=2"
117 "-o" "pre_conv=1" 118 "-o" "pre_conv=1"
118 "-t" (format "%s" tab-width) 119 "-t" (format "%s" tab-width)
119 "-cols" (format "%s" gnus-html-frame-width) 120 "-cols" (format "%s" gnus-html-frame-width)
@@ -253,13 +254,39 @@ fit these criteria."
253 ;; should be deleted. 254 ;; should be deleted.
254 ((equal tag "IMG_ALT") 255 ((equal tag "IMG_ALT")
255 (delete-region start end)) 256 (delete-region start end))
257 ;; w3m does not normalize the case
258 ((or (equal tag "b")
259 (equal tag "B"))
260 (gnus-overlay-put (gnus-make-overlay start end) 'face 'gnus-emphasis-bold))
261 ((or (equal tag "u")
262 (equal tag "U"))
263 (gnus-overlay-put (gnus-make-overlay start end) 'face 'gnus-emphasis-underline))
264 ((or (equal tag "i")
265 (equal tag "I"))
266 (gnus-overlay-put (gnus-make-overlay start end) 'face 'gnus-emphasis-italic))
267 ((or (equal tag "s")
268 (equal tag "S"))
269 (gnus-overlay-put (gnus-make-overlay start end) 'face 'gnus-emphasis-strikethru))
270 ((or (equal tag "ins")
271 (equal tag "INS"))
272 (gnus-overlay-put (gnus-make-overlay start end) 'face 'gnus-emphasis-underline))
273 ;; Handle different UL types
274 ((equal tag "_SYMBOL")
275 (when (string-match "TYPE=\\(.+\\)" parameters)
276 (let ((type (string-to-number (match-string 1 parameters))))
277 (delete-region start end)
278 (cond ((= type 33) (insert " "))
279 ((= type 34) (insert " "))
280 ((= type 35) (insert " "))
281 ((= type 36) (insert " "))
282 ((= type 37) (insert " "))
283 ((= type 38) (insert " "))
284 ((= type 39) (insert " "))
285 ((= type 40) (insert " "))
286 ((= type 42) (insert " "))
287 ((= type 43) (insert " "))
288 (t (insert " "))))))
256 ;; Whatever. Just ignore the tag. 289 ;; Whatever. Just ignore the tag.
257 ((equal tag "b")
258 (gnus-overlay-put (gnus-make-overlay start end) 'face 'bold))
259 ((equal tag "U")
260 (gnus-overlay-put (gnus-make-overlay start end) 'face 'underline))
261 ((equal tag "i")
262 (gnus-overlay-put (gnus-make-overlay start end) 'face 'italic))
263 (t 290 (t
264 )) 291 ))
265 (goto-char start)) 292 (goto-char start))
@@ -307,23 +334,25 @@ fit these criteria."
307 (expand-file-name (sha1 url) gnus-html-cache-directory)) 334 (expand-file-name (sha1 url) gnus-html-cache-directory))
308 335
309(defun gnus-html-image-fetched (status buffer image) 336(defun gnus-html-image-fetched (status buffer image)
310 (when (and (buffer-live-p buffer) 337 (let ((file (gnus-html-image-id (car image))))
311 ;; If the position of the marker is 1, then that 338 ;; Search the start of the image data
312 ;; means that the text it was in has been deleted; 339 (when (search-forward "\n\n" nil t)
313 ;; i.e., that the user has selected a different 340 ;; Write region (image data) silently
314 ;; article before the image arrived.
315 (not (= (marker-position (cadr image)) (point-min))))
316 (let ((file (gnus-html-image-id (car image))))
317 ;; Search the start of the image data
318 (search-forward "\n\n")
319 ;; Write region (image) silently
320 (write-region (point) (point-max) file nil 1) 341 (write-region (point) (point-max) file nil 1)
321 (kill-buffer) 342 (kill-buffer)
322 (with-current-buffer buffer 343 (when (and (buffer-live-p buffer)
323 (let ((inhibit-read-only t) 344 ;; If the `image' has no marker, do not replace anything
324 (string (buffer-substring (cadr image) (caddr image)))) 345 (cadr image)
325 (delete-region (cadr image) (caddr image)) 346 ;; If the position of the marker is 1, then that
326 (gnus-html-put-image file (cadr image) string)))))) 347 ;; means that the text it was in has been deleted;
348 ;; i.e., that the user has selected a different
349 ;; article before the image arrived.
350 (not (= (marker-position (cadr image)) (point-min))))
351 (with-current-buffer buffer
352 (let ((inhibit-read-only t)
353 (string (buffer-substring (cadr image) (caddr image))))
354 (delete-region (cadr image) (caddr image))
355 (gnus-html-put-image file (cadr image) (car image) string)))))))
327 356
328(defun gnus-html-put-image (file point string &optional url alt-text) 357(defun gnus-html-put-image (file point string &optional url alt-text)
329 (when (gnus-graphic-display-p) 358 (when (gnus-graphic-display-p)
@@ -441,27 +470,18 @@ This only works if the article in question is HTML."
441 470
442;;;###autoload 471;;;###autoload
443(defun gnus-html-prefetch-images (summary) 472(defun gnus-html-prefetch-images (summary)
444 (let (blocked-images urls) 473 (when (buffer-live-p summary)
445 (when (and (buffer-live-p summary) 474 (let ((blocked-images (with-current-buffer summary
446 (executable-find "curl")) 475 gnus-blocked-images)))
447 (with-current-buffer summary
448 (setq blocked-images gnus-blocked-images))
449 (save-match-data 476 (save-match-data
450 (while (re-search-forward "<img.*src=[\"']\\([^\"']+\\)" nil t) 477 (while (re-search-forward "<img.*src=[\"']\\([^\"']+\\)" nil t)
451 (let ((url (match-string 1))) 478 (let ((url (match-string 1)))
452 (unless (gnus-html-image-url-blocked-p url blocked-images) 479 (unless (gnus-html-image-url-blocked-p url blocked-images)
453 (unless (file-exists-p (gnus-html-image-id url)) 480 (unless (file-exists-p (gnus-html-image-id url))
454 (push (mm-url-decode-entities-string url) urls) 481 (ignore-errors
455 (push (gnus-html-image-id url) urls) 482 (url-retrieve (mm-url-decode-entities-string url)
456 (push "-o" urls))))) 483 'gnus-html-image-fetched
457 (let ((process 484 (list nil (list url))))))))))))
458 (apply 'start-process
459 "images" nil "curl"
460 "-s" "--create-dirs"
461 "--location"
462 "--max-time" "60"
463 urls)))
464 (gnus-set-process-query-on-exit-flag process nil))))))
465 485
466(provide 'gnus-html) 486(provide 'gnus-html)
467 487
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index bcfc015c2df..f245907ed1b 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -245,9 +245,8 @@ If it is down, start it up (again)."
245 (nth 1 gnus-command-method) 245 (nth 1 gnus-command-method)
246 (nthcdr 2 gnus-command-method)) 246 (nthcdr 2 gnus-command-method))
247 (error 247 (error
248 (gnus-message 1 (format 248 (gnus-message 1 "Unable to open server %s due to: %s"
249 "Unable to open server %s due to: %s" 249 server (error-message-string err))
250 server (error-message-string err)))
251 nil) 250 nil)
252 (quit 251 (quit
253 (gnus-message 1 "Quit trying to open server %s" server) 252 (gnus-message 1 "Quit trying to open server %s" server)
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index 5cd60ddaabf..03ff30d2b4b 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -1114,8 +1114,8 @@ EXTRA is the possible non-standard header."
1114 (make-local-variable 'gnus-prev-winconf) 1114 (make-local-variable 'gnus-prev-winconf)
1115 (setq gnus-prev-winconf winconf)) 1115 (setq gnus-prev-winconf winconf))
1116 (gnus-message 1116 (gnus-message
1117 4 (substitute-command-keys 1117 4 "%s" (substitute-command-keys
1118 "\\<gnus-score-mode-map>\\[gnus-score-edit-exit] to save edits")))) 1118 "\\<gnus-score-mode-map>\\[gnus-score-edit-exit] to save edits"))))
1119 1119
1120(defun gnus-score-edit-all-score () 1120(defun gnus-score-edit-all-score ()
1121 "Edit the all.SCORE file." 1121 "Edit the all.SCORE file."
@@ -1142,8 +1142,8 @@ EXTRA is the possible non-standard header."
1142 (make-local-variable 'gnus-prev-winconf) 1142 (make-local-variable 'gnus-prev-winconf)
1143 (setq gnus-prev-winconf winconf)) 1143 (setq gnus-prev-winconf winconf))
1144 (gnus-message 1144 (gnus-message
1145 4 (substitute-command-keys 1145 4 "%s" (substitute-command-keys
1146 "\\<gnus-score-mode-map>\\[gnus-score-edit-exit] to save edits"))) 1146 "\\<gnus-score-mode-map>\\[gnus-score-edit-exit] to save edits")))
1147 1147
1148(defun gnus-score-edit-file-at-point (&optional format) 1148(defun gnus-score-edit-file-at-point (&optional format)
1149 "Edit score file at point in Score Trace buffers. 1149 "Edit score file at point in Score Trace buffers.
@@ -1391,7 +1391,7 @@ If FORMAT, also format the current score file."
1391 (if err 1391 (if err
1392 (progn 1392 (progn
1393 (ding) 1393 (ding)
1394 (gnus-message 3 err) 1394 (gnus-message 3 "%s" err)
1395 (sit-for 2) 1395 (sit-for 2)
1396 nil) 1396 nil)
1397 alist))))) 1397 alist)))))
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index dd5e51885c2..2966212de69 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -976,7 +976,7 @@ If NUMBER, fetch this number of articles."
976(defun gnus-browse-describe-briefly () 976(defun gnus-browse-describe-briefly ()
977 "Give a one line description of the group mode commands." 977 "Give a one line description of the group mode commands."
978 (interactive) 978 (interactive)
979 (gnus-message 6 979 (gnus-message 6 "%s"
980 (substitute-command-keys "\\<gnus-browse-mode-map>\\[gnus-group-next-group]:Forward \\[gnus-group-prev-group]:Backward \\[gnus-browse-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-browse-describe-briefly]:This help"))) 980 (substitute-command-keys "\\<gnus-browse-mode-map>\\[gnus-group-next-group]:Forward \\[gnus-group-prev-group]:Backward \\[gnus-browse-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-browse-describe-briefly]:This help")))
981 981
982(defun gnus-server-regenerate-server () 982(defun gnus-server-regenerate-server ()
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 18553071bf0..f4745c184e5 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -268,7 +268,7 @@ not match this regexp will be removed before saving the list."
268 (mapconcat 'identity 268 (mapconcat 'identity
269 '("^to\\." ; not "real" groups 269 '("^to\\." ; not "real" groups
270 "^[0-9. \t]+\\( \\|$\\)" ; all digits in name 270 "^[0-9. \t]+\\( \\|$\\)" ; all digits in name
271 "^[\"][]\"[#'()]" ; bogus characters 271 "^[\"][\"#'()]" ; bogus characters
272 ) 272 )
273 "\\|") 273 "\\|")
274 "*A regexp to match uninteresting newsgroups in the active file. 274 "*A regexp to match uninteresting newsgroups in the active file.
@@ -1759,14 +1759,16 @@ If SCAN, request a scan of that group as well."
1759 (dolist (elem type-cache) 1759 (dolist (elem type-cache)
1760 (destructuring-bind (method method-type infos dummy) elem 1760 (destructuring-bind (method method-type infos dummy) elem
1761 (when (and method infos 1761 (when (and method infos
1762 (not (gnus-method-denied-p method)) 1762 (not (gnus-method-denied-p method)))
1763 (gnus-check-backend-function 1763 (unless (gnus-server-opened method)
1764 'retrieve-group-data-early (car method))) 1764 (gnus-open-server method))
1765 (when (gnus-check-backend-function 'request-scan (car method)) 1765 (when (gnus-check-backend-function
1766 (dolist (info infos) 1766 'retrieve-group-data-early (car method))
1767 (gnus-request-scan (gnus-info-group info) method))) 1767 (when (gnus-check-backend-function 'request-scan (car method))
1768 (setcar (nthcdr 3 elem) 1768 (dolist (info infos)
1769 (gnus-retrieve-group-data-early method infos))))) 1769 (gnus-request-scan (gnus-info-group info) method)))
1770 (setcar (nthcdr 3 elem)
1771 (gnus-retrieve-group-data-early method infos))))))
1770 1772
1771 ;; Do the rest of the retrieval. 1773 ;; Do the rest of the retrieval.
1772 (dolist (elem type-cache) 1774 (dolist (elem type-cache)
@@ -2054,7 +2056,7 @@ If SCAN, request a scan of that group as well."
2054 (if (and where (not (zerop (length where)))) 2056 (if (and where (not (zerop (length where))))
2055 (concat " from " where) "") 2057 (concat " from " where) "")
2056 (car method))) 2058 (car method)))
2057 (gnus-message 5 mesg) 2059 (gnus-message 5 "%s" mesg)
2058 (when (gnus-check-server method) 2060 (when (gnus-check-server method)
2059 ;; Request that the backend scan its incoming messages. 2061 ;; Request that the backend scan its incoming messages.
2060 (when (and (or (and gnus-agent 2062 (when (and (or (and gnus-agent
@@ -2089,7 +2091,7 @@ If SCAN, request a scan of that group as well."
2089 (unless (equal method gnus-message-archive-method) 2091 (unless (equal method gnus-message-archive-method)
2090 (gnus-error 1 "Cannot read active file from %s server" 2092 (gnus-error 1 "Cannot read active file from %s server"
2091 (car method))) 2093 (car method)))
2092 (gnus-message 5 mesg) 2094 (gnus-message 5 "%s" mesg)
2093 (gnus-active-to-gnus-format method gnus-active-hashtb nil t) 2095 (gnus-active-to-gnus-format method gnus-active-hashtb nil t)
2094 ;; We mark this active file as read. 2096 ;; We mark this active file as read.
2095 (push method gnus-have-read-active-file) 2097 (push method gnus-have-read-active-file)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 3c3a0590536..c35cb2584c5 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -7330,7 +7330,7 @@ in."
7330(defun gnus-summary-describe-briefly () 7330(defun gnus-summary-describe-briefly ()
7331 "Describe summary mode commands briefly." 7331 "Describe summary mode commands briefly."
7332 (interactive) 7332 (interactive)
7333 (gnus-message 6 (substitute-command-keys "\\<gnus-summary-mode-map>\\[gnus-summary-next-page]:Select \\[gnus-summary-next-unread-article]:Forward \\[gnus-summary-prev-unread-article]:Backward \\[gnus-summary-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-summary-describe-briefly]:This help"))) 7333 (gnus-message 6 "%s" (substitute-command-keys "\\<gnus-summary-mode-map>\\[gnus-summary-next-page]:Select \\[gnus-summary-next-unread-article]:Forward \\[gnus-summary-prev-unread-article]:Backward \\[gnus-summary-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-summary-describe-briefly]:This help")))
7334 7334
7335;; Walking around group mode buffer from summary mode. 7335;; Walking around group mode buffer from summary mode.
7336 7336
@@ -10768,7 +10768,11 @@ If NO-EXPIRE, auto-expiry will be inhibited."
10768 ;; Go to the right position on the line. 10768 ;; Go to the right position on the line.
10769 (goto-char (+ forward (point))) 10769 (goto-char (+ forward (point)))
10770 ;; Replace the old mark with the new mark. 10770 ;; Replace the old mark with the new mark.
10771 (subst-char-in-region (point) (1+ (point)) (char-after) mark) 10771 (let ((to-insert
10772 (subst-char-in-string (char-after) mark
10773 (buffer-substring (point) (1+ (point))))))
10774 (delete-region (point) (1+ (point)))
10775 (insert to-insert))
10772 ;; Optionally update the marks by some user rule. 10776 ;; Optionally update the marks by some user rule.
10773 (when (eq type 'unread) 10777 (when (eq type 'unread)
10774 (gnus-data-set-mark 10778 (gnus-data-set-mark
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 2173d713d11..68f7f5f5e1a 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -3678,6 +3678,41 @@ that that variable is buffer-local to the summary buffers."
3678 gnus-valid-select-methods))) 3678 gnus-valid-select-methods)))
3679 (equal (nth 1 m1) (nth 1 m2))))))) 3679 (equal (nth 1 m1) (nth 1 m2)))))))
3680 3680
3681(defun gnus-methods-sloppily-equal (m1 m2)
3682 ;; Same method.
3683 (or
3684 (eq m1 m2)
3685 ;; Type and name are equal.
3686 (and
3687 (eq (car m1) (car m2))
3688 (equal (cadr m1) (cadr m2))
3689 ;; Check parameters for sloppy equalness.
3690 (let ((p1 (copy-list (cddr m1)))
3691 (p2 (copy-list (cddr m2)))
3692 e1 e2)
3693 (block nil
3694 (while (setq e1 (pop p1))
3695 (unless (setq e2 (assq (car e1) p2))
3696 ;; The parameter doesn't exist in p2.
3697 (return nil))
3698 (setq p2 (delq e2 p2))
3699 (unless (equalp e1 e2)
3700 (if (not (and (stringp (cadr e1))
3701 (stringp (cadr e2))))
3702 (return nil)
3703 ;; Special-case string parameter comparison so that we
3704 ;; can uniquify them.
3705 (let ((s1 (cadr e1))
3706 (s2 (cadr e2)))
3707 (when (string-match "/$" s1)
3708 (setq s1 (directory-file-name s1)))
3709 (when (string-match "/$" s2)
3710 (setq s2 (directory-file-name s2)))
3711 (unless (equal s1 s2)
3712 (return nil))))))
3713 ;; If p2 now is empty, they were equal.
3714 (null p2))))))
3715
3681(defun gnus-server-equal (m1 m2) 3716(defun gnus-server-equal (m1 m2)
3682 "Say whether two methods are equal." 3717 "Say whether two methods are equal."
3683 (let ((m1 (cond ((null m1) gnus-select-method) 3718 (let ((m1 (cond ((null m1) gnus-select-method)
@@ -4142,13 +4177,19 @@ If NEWSGROUP is nil, return the global kill file name instead."
4142 gnus-valid-select-methods))) 4177 gnus-valid-select-methods)))
4143 4178
4144(defun gnus-similar-server-opened (method) 4179(defun gnus-similar-server-opened (method)
4145 (let ((opened gnus-opened-servers)) 4180 "Return non-nil if we have a similar server opened.
4181This is defined as a server with the same name, but different
4182parameters."
4183 (let ((opened gnus-opened-servers)
4184 open)
4146 (while (and method opened) 4185 (while (and method opened)
4147 (when (and (equal (cadr method) (cadaar opened)) 4186 (setq open (car (pop opened)))
4148 (equal (car method) (caaar opened)) 4187 ;; Type and name are the same...
4149 (not (equal method (caar opened)))) 4188 (when (and (equal (car method) (car open))
4150 (setq method nil)) 4189 (equal (cadr method) (cadr open))
4151 (pop opened)) 4190 ;; ... but the rest of the parameters differ.
4191 (not (gnus-methods-sloppily-equal method open)))
4192 (setq method nil)))
4152 (not method))) 4193 (not method)))
4153 4194
4154(defun gnus-server-extend-method (group method) 4195(defun gnus-server-extend-method (group method)
@@ -4397,6 +4438,10 @@ If ARG is non-nil and a positive number, Gnus will use that as the
4397startup level. If ARG is non-nil and not a positive number, Gnus will 4438startup level. If ARG is non-nil and not a positive number, Gnus will
4398prompt the user for the name of an NNTP server to use." 4439prompt the user for the name of an NNTP server to use."
4399 (interactive "P") 4440 (interactive "P")
4441 ;; When using the development version of Gnus, load the gnus-load
4442 ;; file.
4443 (unless (string-match "^Gnus" gnus-version)
4444 (load "gnus-load"))
4400 (unless (byte-code-function-p (symbol-function 'gnus)) 4445 (unless (byte-code-function-p (symbol-function 'gnus))
4401 (message "You should byte-compile Gnus") 4446 (message "You should byte-compile Gnus")
4402 (sit-for 2)) 4447 (sit-for 2))
diff --git a/lisp/gnus/mail-parse.el b/lisp/gnus/mail-parse.el
index e6977705f21..169b70a266e 100644
--- a/lisp/gnus/mail-parse.el
+++ b/lisp/gnus/mail-parse.el
@@ -45,8 +45,7 @@
45(defalias 'mail-header-parse-content-type 'rfc2231-parse-qp-string) 45(defalias 'mail-header-parse-content-type 'rfc2231-parse-qp-string)
46(defalias 'mail-header-parse-content-disposition 'rfc2231-parse-qp-string) 46(defalias 'mail-header-parse-content-disposition 'rfc2231-parse-qp-string)
47(defalias 'mail-content-type-get 'rfc2231-get-value) 47(defalias 'mail-content-type-get 'rfc2231-get-value)
48;(defalias 'mail-header-encode-parameter 'rfc2045-encode-string) 48(defalias 'mail-header-encode-parameter 'rfc2045-encode-string)
49(defalias 'mail-header-encode-parameter 'rfc2231-encode-string)
50 49
51(defalias 'mail-header-remove-comments 'ietf-drums-remove-comments) 50(defalias 'mail-header-remove-comments 'ietf-drums-remove-comments)
52(defalias 'mail-header-remove-whitespace 'ietf-drums-remove-whitespace) 51(defalias 'mail-header-remove-whitespace 'ietf-drums-remove-whitespace)
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index 1bfdbeab9c4..03014e540c6 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -463,7 +463,7 @@ on your system, you could say something like:
463 (let ((extra (mail-header-extra header))) 463 (let ((extra (mail-header-extra header)))
464 (while extra 464 (while extra
465 (insert (symbol-name (caar extra)) 465 (insert (symbol-name (caar extra))
466 ": " (cdar extra) "\t") 466 ": " (if (stringp (cdar extra)) (cdar extra) "") "\t")
467 (pop extra)))) 467 (pop extra))))
468 (insert "\n") 468 (insert "\n")
469 (backward-char 1) 469 (backward-char 1)
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index c27b3ec776b..b3a9e5bcdc4 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -66,6 +66,17 @@ Values are `ssl' and `network'.")
66This is always done if the server supports UID EXPUNGE, but it's 66This is always done if the server supports UID EXPUNGE, but it's
67not done by default on servers that doesn't support that command.") 67not done by default on servers that doesn't support that command.")
68 68
69(defvoo nnimap-authenticator nil
70 "How nnimap authenticate itself to the server.
71Possible choices are nil (use default methods) or `anonymous'.")
72
73(defvoo nnimap-fetch-partial-articles nil
74 "If non-nil, nnimap will fetch partial articles.
75If t, nnimap will fetch only the first part. If a string, it
76will fetch all parts that have types that match that string. A
77likely value would be \"text/\" to automatically fetch all
78textual parts.")
79
69(defvoo nnimap-connection-alist nil) 80(defvoo nnimap-connection-alist nil)
70 81
71(defvoo nnimap-current-infos nil) 82(defvoo nnimap-current-infos nil)
@@ -146,7 +157,7 @@ not done by default on servers that doesn't support that command.")
146 (delete-region (line-beginning-position) (line-end-position)) 157 (delete-region (line-beginning-position) (line-end-position))
147 (insert (format "211 %s Article retrieved." article)) 158 (insert (format "211 %s Article retrieved." article))
148 (forward-line 1) 159 (forward-line 1)
149 (insert (format "Bytes: %d\n" bytes)) 160 (insert (format "Chars: %d\n" bytes))
150 (when lines 161 (when lines
151 (insert (format "Lines: %s\n" lines))) 162 (insert (format "Lines: %s\n" lines)))
152 (re-search-forward "^\r$") 163 (re-search-forward "^\r$")
@@ -254,7 +265,14 @@ not done by default on servers that doesn't support that command.")
254 (when (setq connection-result (nnimap-wait-for-connection)) 265 (when (setq connection-result (nnimap-wait-for-connection))
255 (unless (equal connection-result "PREAUTH") 266 (unless (equal connection-result "PREAUTH")
256 (if (not (setq credentials 267 (if (not (setq credentials
257 (nnimap-credentials nnimap-address ports))) 268 (if (eq nnimap-authenticator 'anonymous)
269 (list "anonymous"
270 (message-make-address))
271 (nnimap-credentials
272 nnimap-address
273 (if nnimap-server-port
274 (cons (format "%s" nnimap-server-port) ports)
275 ports)))))
258 (setq nnimap-object nil) 276 (setq nnimap-object nil)
259 (setq login-result (nnimap-command "LOGIN %S %S" 277 (setq login-result (nnimap-command "LOGIN %S %S"
260 (car credentials) 278 (car credentials)
@@ -302,7 +320,8 @@ not done by default on servers that doesn't support that command.")
302 320
303(deffoo nnimap-request-article (article &optional group server to-buffer) 321(deffoo nnimap-request-article (article &optional group server to-buffer)
304 (with-current-buffer nntp-server-buffer 322 (with-current-buffer nntp-server-buffer
305 (let ((result (nnimap-possibly-change-group group server))) 323 (let ((result (nnimap-possibly-change-group group server))
324 parts)
306 (when (stringp article) 325 (when (stringp article)
307 (setq article (nnimap-find-article-by-message-id group article))) 326 (setq article (nnimap-find-article-by-message-id group article)))
308 (when (and result 327 (when (and result
@@ -310,6 +329,14 @@ not done by default on servers that doesn't support that command.")
310 (erase-buffer) 329 (erase-buffer)
311 (with-current-buffer (nnimap-buffer) 330 (with-current-buffer (nnimap-buffer)
312 (erase-buffer) 331 (erase-buffer)
332 (when nnimap-fetch-partial-articles
333 (if (eq nnimap-fetch-partial-articles t)
334 (setq parts '(1))
335 (nnimap-command "UID FETCH %d (BODYSTRUCTURE)" article)
336 (goto-char (point-min))
337 (when (re-search-forward "FETCH.*BODYSTRUCTURE" nil t)
338 (let ((structure (ignore-errors (read (current-buffer)))))
339 (setq parts (nnimap-find-wanted-parts structure))))))
313 (setq result 340 (setq result
314 (nnimap-command 341 (nnimap-command
315 (if (member "IMAP4REV1" (nnimap-capabilities nnimap-object)) 342 (if (member "IMAP4REV1" (nnimap-capabilities nnimap-object))
@@ -331,7 +358,30 @@ not done by default on servers that doesn't support that command.")
331 (goto-char (+ (point) bytes)) 358 (goto-char (+ (point) bytes))
332 (delete-region (point) (point-max)) 359 (delete-region (point) (point-max))
333 (nnheader-ms-strip-cr)) 360 (nnheader-ms-strip-cr))
334 t))))))) 361 (cons group article))))))))
362
363(defun nnimap-find-wanted-parts (structure)
364 (message-flatten-list (nnimap-find-wanted-parts-1 structure "")))
365
366(defun nnimap-find-wanted-parts-1 (structure prefix)
367 (let ((num 1)
368 parts)
369 (while (consp (car structure))
370 (let ((sub (pop structure)))
371 (if (consp (car sub))
372 (push (nnimap-find-wanted-parts-1
373 sub (if (string= prefix "")
374 (number-to-string num)
375 (format "%s.%s" prefix num)))
376 parts)
377 (let ((type (format "%s/%s" (nth 0 sub) (nth 1 sub))))
378 (when (string-match nnimap-fetch-partial-articles type)
379 (push (if (string= prefix "")
380 (number-to-string num)
381 (format "%s.%s" prefix num))
382 parts)))
383 (incf num))))
384 (nreverse parts)))
335 385
336(deffoo nnimap-request-group (group &optional server dont-check info) 386(deffoo nnimap-request-group (group &optional server dont-check info)
337 (with-current-buffer nntp-server-buffer 387 (with-current-buffer nntp-server-buffer
@@ -825,21 +875,25 @@ not done by default on servers that doesn't support that command.")
825 (goto-char (point-min)) 875 (goto-char (point-min))
826 (while (and (memq (process-status process) 876 (while (and (memq (process-status process)
827 '(open run)) 877 '(open run))
828 (not (re-search-forward "^\\* " nil t))) 878 (not (re-search-forward "^\\* .*\n" nil t)))
829 (nnheader-accept-process-output process) 879 (nnheader-accept-process-output process)
830 (goto-char (point-min))) 880 (goto-char (point-min)))
831 (and (looking-at "[A-Z0-9]+") 881 (forward-line -1)
832 (match-string 0)))) 882 (and (looking-at "\\* \\([A-Z0-9]+\\)")
883 (match-string 1))))
833 884
834(defun nnimap-wait-for-response (sequence &optional messagep) 885(defun nnimap-wait-for-response (sequence &optional messagep)
835 (goto-char (point-max)) 886 (let ((process (get-buffer-process (current-buffer))))
836 (while (not (re-search-backward (format "^%d .*\n" sequence) 887 (goto-char (point-max))
837 (max (point-min) (- (point) 500)) 888 (while (and (memq (process-status process)
838 t)) 889 '(open run))
839 (when messagep 890 (not (re-search-backward (format "^%d .*\n" sequence)
840 (message "Read %dKB" (/ (buffer-size) 1000))) 891 (max (point-min) (- (point) 500))
841 (nnheader-accept-process-output (get-buffer-process (current-buffer))) 892 t)))
842 (goto-char (point-max)))) 893 (when messagep
894 (message "Read %dKB" (/ (buffer-size) 1000)))
895 (nnheader-accept-process-output process)
896 (goto-char (point-max)))))
843 897
844(defun nnimap-parse-response () 898(defun nnimap-parse-response ()
845 (let ((lines (split-string (nnimap-last-response-string) "\r\n" t)) 899 (let ((lines (split-string (nnimap-last-response-string) "\r\n" t))