diff options
| author | Lars Magne Ingebrigtsen | 2010-09-18 23:36:29 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-09-18 23:36:29 +0000 |
| commit | 286c4fc2a9d08ee184cda096760ad3e8c7cf0989 (patch) | |
| tree | 2e20dff5ad2f571e6fd416cc5f1b1392ce82111d | |
| parent | 77413977a32d72b4c7a78b5ad63ea4937dad00eb (diff) | |
| download | emacs-286c4fc2a9d08ee184cda096760ad3e8c7cf0989.tar.gz emacs-286c4fc2a9d08ee184cda096760ad3e8c7cf0989.zip | |
Merge changes made in Gnus trunk.
nnimap.el (nnimap-request-group): Use the stored info for the dont-check case.
nnimap.el: Use deffoo instead of defun for interface functions.
gnus-int.el (gnus-request-group): Take an optional `info' parameter.
nnimap.el: Allow nnimap-request-group to do a complete marks sync on `M-g'.
nnimap.el: Get credentials for numerical equivalents of the port numbers.
gnus-html.el (gnus-html-wash-tags): Add support for i, b and u HTML tags.
nnimap.el (nnimap-update-info): Extend the info so that we can set the marks.
nnimap.el (nnimap-open-connection): Fix typo -- should be 'shell, not 'stream.
nnimap.el: Allow PREAUTH nnimap connections to log in without credentials.
nnimap.el (nnimap-update-info): Fix off-by-one error when concatenating ranges when doing a partial update.
gnus-html.el (gnus-html-schedule-image-fetching): Use `url' rather than curl to retrieve images.
nnimap.el (nnimap-update-info): When doing partial marks update, get the range update right.
nnimap.el (nnimap-wait-for-response): Be a bit more lax in finding the end of the command we're looking for.
nnimap.el: Allow sending \n instead of \r\n on 'shell streams.
gnus-html.el (gnus-html-schedule-image-fetching): Fetch all images in parallel.
| -rw-r--r-- | lisp/gnus/ChangeLog | 63 | ||||
| -rw-r--r-- | lisp/gnus/gnus-html.el | 61 | ||||
| -rw-r--r-- | lisp/gnus/gnus-int.el | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-start.el | 6 | ||||
| -rw-r--r-- | lisp/gnus/nnagent.el | 4 | ||||
| -rw-r--r-- | lisp/gnus/nnbabyl.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nndiary.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nndoc.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nndraft.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nneething.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnfolder.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnimap.el | 207 | ||||
| -rw-r--r-- | lisp/gnus/nnir.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnmaildir.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnmairix.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnmbox.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnmh.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnml.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnnil.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnrss.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnspool.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nntp.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnvirtual.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nnweb.el | 2 |
24 files changed, 256 insertions, 126 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 25e17538730..a7d29366cb7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,6 +1,67 @@ | |||
| 1 | 2010-09-18 Julien Danjou <julien@danjou.info> | ||
| 2 | |||
| 3 | * gnus-html.el (gnus-html-schedule-image-fetching): Fetch all images in | ||
| 4 | parallel. | ||
| 5 | |||
| 6 | 2010-09-18 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 7 | |||
| 8 | * nnimap.el (nnimap-update-info): When doing partial marks update, get | ||
| 9 | the range update right. | ||
| 10 | (nnimap-request-group): Don't make `M-g' bug out on group with no | ||
| 11 | marks. | ||
| 12 | (nnoo): Required, so that other packages can require nnimap. | ||
| 13 | (nnimap-wait-for-response): Be a bit more lax in finding the end of the | ||
| 14 | command we're looking for. This helps when the server sends more | ||
| 15 | responses after we've gotten everything we expected. | ||
| 16 | (nnimap): Add a `newlinep' field to keep track of end-of-line | ||
| 17 | conventions. | ||
| 18 | Don't send CRLF to things that don't want it. | ||
| 19 | (nnimap-request-accept-article): Ditto. | ||
| 20 | |||
| 21 | 2010-09-18 Julien Danjou <julien@danjou.info> | ||
| 22 | |||
| 23 | * gnus-html.el (gnus-html-schedule-image-fetching): Use `url' rather | ||
| 24 | than curl to retrieve images. | ||
| 25 | |||
| 26 | 2010-09-18 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 27 | |||
| 28 | * nnimap.el (nnimap-update-info): Extend the info so that we can set | ||
| 29 | the marks. | ||
| 30 | (nnimap-open-connection): Fix typo -- should be 'shell, not 'stream. | ||
| 31 | (nnimap-wait-for-connection): New function. | ||
| 32 | (nnimap-open-connection): If we have PREAUTH, don't query for login | ||
| 33 | credentials. | ||
| 34 | (nnimap-update-info): Fix off-by-one error when concatenating ranges | ||
| 35 | when doing a partial update. | ||
| 36 | |||
| 37 | 2010-09-18 Julien Danjou <julien@danjou.info> | ||
| 38 | |||
| 39 | * gnus-html.el (gnus-html-wash-tags): Add support for i, b and u HTML | ||
| 40 | tags. | ||
| 41 | |||
| 1 | 2010-09-18 Lars Magne Ingebrigtsen <larsi@gnus.org> | 42 | 2010-09-18 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 43 | ||
| 3 | * nnimap.el: Require nnoo and other files necessary. | 44 | * nnimap.el (nnimap-credentials): New function. |
| 45 | (nnimap-open-connection): Use the new function to look for credentials | ||
| 46 | also on the numeric equivalents of "imap" and "imaps". | ||
| 47 | |||
| 48 | * gnus-start.el (gnus-activate-group): Send the info to | ||
| 49 | gnus-request-group. | ||
| 50 | |||
| 51 | * nnimap.el (nnimap-request-group): Have the "check" version of the | ||
| 52 | function parse flags and update the info, so that a `M-g' get a total | ||
| 53 | resync of all flags from the group. | ||
| 54 | |||
| 55 | * gnus-int.el (gnus-request-group): Take an optional `info' parameter | ||
| 56 | to allow backends to alter the info on group selection. Also alter all | ||
| 57 | the backend -request-group functions to take the parameter. | ||
| 58 | |||
| 59 | * nnimap.el (nnimap-store-info): New function. | ||
| 60 | (nnimap-update-info): Store the info for later usage. | ||
| 61 | (nnimap-request-group): Use the stored info for the dont-check case, so | ||
| 62 | that we don't retrieve all marks when we enter a group. | ||
| 63 | |||
| 64 | * nnimap.el: Use deffoo instead of defun for interface functions. | ||
| 4 | 65 | ||
| 5 | * gnus-start.el (gnus-get-unread-articles): Allow the backends to | 66 | * gnus-start.el (gnus-get-unread-articles): Allow the backends to |
| 6 | update the group info. This makes the nndraft groups, for instance, go | 67 | update the group info. This makes the nndraft groups, for instance, go |
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index c390ae0bcf2..b2ecb5cdf68 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | 33 | ||
| 34 | (require 'gnus-art) | 34 | (require 'gnus-art) |
| 35 | (require 'mm-url) | 35 | (require 'mm-url) |
| 36 | (require 'url) | ||
| 36 | 37 | ||
| 37 | (defcustom gnus-html-cache-directory (nnheader-concat gnus-directory "html-cache/") | 38 | (defcustom gnus-html-cache-directory (nnheader-concat gnus-directory "html-cache/") |
| 38 | "Where Gnus will cache images it downloads from the web." | 39 | "Where Gnus will cache images it downloads from the web." |
| @@ -253,6 +254,12 @@ fit these criteria." | |||
| 253 | ((equal tag "IMG_ALT") | 254 | ((equal tag "IMG_ALT") |
| 254 | (delete-region start end)) | 255 | (delete-region start end)) |
| 255 | ;; Whatever. Just ignore the tag. | 256 | ;; 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)) | ||
| 256 | (t | 263 | (t |
| 257 | )) | 264 | )) |
| 258 | (goto-char start)) | 265 | (goto-char start)) |
| @@ -290,42 +297,32 @@ fit these criteria." | |||
| 290 | (defun gnus-html-schedule-image-fetching (buffer images) | 297 | (defun gnus-html-schedule-image-fetching (buffer images) |
| 291 | (gnus-message 8 "gnus-html-schedule-image-fetching: buffer %s, images %s" | 298 | (gnus-message 8 "gnus-html-schedule-image-fetching: buffer %s, images %s" |
| 292 | buffer images) | 299 | buffer images) |
| 293 | (when (executable-find "curl") | 300 | (dolist (image images) |
| 294 | (let* ((url (caar images)) | 301 | (url-retrieve (car image) |
| 295 | (process (start-process | 302 | 'gnus-html-image-fetched |
| 296 | "images" nil "curl" | 303 | (list buffer image)))) |
| 297 | "-s" "--create-dirs" | ||
| 298 | "--location" | ||
| 299 | "--max-time" "60" | ||
| 300 | "-o" (gnus-html-image-id url) | ||
| 301 | (mm-url-decode-entities-string url)))) | ||
| 302 | (gnus-set-process-query-on-exit-flag process nil) | ||
| 303 | (set-process-sentinel process 'gnus-html-curl-sentinel) | ||
| 304 | (gnus-set-process-plist process (list 'images images | ||
| 305 | 'buffer buffer))))) | ||
| 306 | 304 | ||
| 307 | (defun gnus-html-image-id (url) | 305 | (defun gnus-html-image-id (url) |
| 308 | (expand-file-name (sha1 url) gnus-html-cache-directory)) | 306 | (expand-file-name (sha1 url) gnus-html-cache-directory)) |
| 309 | 307 | ||
| 310 | (defun gnus-html-curl-sentinel (process event) | 308 | (defun gnus-html-image-fetched (status buffer image) |
| 311 | (when (string-match "finished" event) | 309 | (when (and (buffer-live-p buffer) |
| 312 | (let* ((images (gnus-process-get process 'images)) | 310 | ;; If the position of the marker is 1, then that |
| 313 | (buffer (gnus-process-get process 'buffer)) | 311 | ;; means that the text it was in has been deleted; |
| 314 | (spec (pop images)) | 312 | ;; i.e., that the user has selected a different |
| 315 | (file (gnus-html-image-id (car spec)))) | 313 | ;; article before the image arrived. |
| 316 | (when (and (buffer-live-p buffer) | 314 | (not (= (marker-position (cadr image)) (point-min)))) |
| 317 | ;; If the position of the marker is 1, then that | 315 | (let ((file (gnus-html-image-id (car image)))) |
| 318 | ;; means that the text it was in has been deleted; | 316 | ;; Search the start of the image data |
| 319 | ;; i.e., that the user has selected a different | 317 | (search-forward "\n\n") |
| 320 | ;; article before the image arrived. | 318 | ;; Write region (image) silently |
| 321 | (not (= (marker-position (cadr spec)) (point-min)))) | 319 | (write-region (point) (point-max) file nil 1) |
| 322 | (with-current-buffer buffer | 320 | (kill-buffer) |
| 323 | (let ((inhibit-read-only t) | 321 | (with-current-buffer buffer |
| 324 | (string (buffer-substring (cadr spec) (caddr spec)))) | 322 | (let ((inhibit-read-only t) |
| 325 | (delete-region (cadr spec) (caddr spec)) | 323 | (string (buffer-substring (cadr image) (caddr image)))) |
| 326 | (gnus-html-put-image file (cadr spec) string)))) | 324 | (delete-region (cadr image) (caddr image)) |
| 327 | (when images | 325 | (gnus-html-put-image file (cadr image) string)))))) |
| 328 | (gnus-html-schedule-image-fetching buffer images))))) | ||
| 329 | 326 | ||
| 330 | (defun gnus-html-put-image (file point string &optional url alt-text) | 327 | (defun gnus-html-put-image (file point string &optional url alt-text) |
| 331 | (when (gnus-graphic-display-p) | 328 | (when (gnus-graphic-display-p) |
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index 389b1a22a8b..bcfc015c2df 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el | |||
| @@ -375,7 +375,7 @@ If it is down, start it up (again)." | |||
| 375 | (funcall (gnus-get-function gnus-command-method 'request-compact) | 375 | (funcall (gnus-get-function gnus-command-method 'request-compact) |
| 376 | (nth 1 gnus-command-method))) | 376 | (nth 1 gnus-command-method))) |
| 377 | 377 | ||
| 378 | (defun gnus-request-group (group &optional dont-check gnus-command-method) | 378 | (defun gnus-request-group (group &optional dont-check gnus-command-method info) |
| 379 | "Request GROUP. If DONT-CHECK, no information is required." | 379 | "Request GROUP. If DONT-CHECK, no information is required." |
| 380 | (let ((gnus-command-method | 380 | (let ((gnus-command-method |
| 381 | (or gnus-command-method (inline (gnus-find-method-for-group group))))) | 381 | (or gnus-command-method (inline (gnus-find-method-for-group group))))) |
| @@ -384,7 +384,8 @@ If it is down, start it up (again)." | |||
| 384 | (inline (gnus-server-to-method gnus-command-method)))) | 384 | (inline (gnus-server-to-method gnus-command-method)))) |
| 385 | (funcall (inline (gnus-get-function gnus-command-method 'request-group)) | 385 | (funcall (inline (gnus-get-function gnus-command-method 'request-group)) |
| 386 | (gnus-group-real-name group) (nth 1 gnus-command-method) | 386 | (gnus-group-real-name group) (nth 1 gnus-command-method) |
| 387 | dont-check))) | 387 | dont-check |
| 388 | info))) | ||
| 388 | 389 | ||
| 389 | (defun gnus-list-active-group (group) | 390 | (defun gnus-list-active-group (group) |
| 390 | "Request active information on GROUP." | 391 | "Request active information on GROUP." |
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 84835428be2..b421ceed6e5 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el | |||
| @@ -1536,10 +1536,12 @@ If SCAN, request a scan of that group as well." | |||
| 1536 | t) | 1536 | t) |
| 1537 | (if (or debug-on-error debug-on-quit) | 1537 | (if (or debug-on-error debug-on-quit) |
| 1538 | (inline (gnus-request-group group (or dont-sub-check dont-check) | 1538 | (inline (gnus-request-group group (or dont-sub-check dont-check) |
| 1539 | method)) | 1539 | method |
| 1540 | (gnus-get-info group))) | ||
| 1540 | (condition-case nil | 1541 | (condition-case nil |
| 1541 | (inline (gnus-request-group group (or dont-sub-check dont-check) | 1542 | (inline (gnus-request-group group (or dont-sub-check dont-check) |
| 1542 | method)) | 1543 | method |
| 1544 | (gnus-get-info group))) | ||
| 1543 | ;;(error nil) | 1545 | ;;(error nil) |
| 1544 | (quit | 1546 | (quit |
| 1545 | (message "Quit activating %s" group) | 1547 | (message "Quit activating %s" group) |
diff --git a/lisp/gnus/nnagent.el b/lisp/gnus/nnagent.el index ccd4e890da7..9f75b00bbca 100644 --- a/lisp/gnus/nnagent.el +++ b/lisp/gnus/nnagent.el | |||
| @@ -190,9 +190,9 @@ | |||
| 190 | (deffoo nnagent-request-expire-articles (articles group &optional server force) | 190 | (deffoo nnagent-request-expire-articles (articles group &optional server force) |
| 191 | articles) | 191 | articles) |
| 192 | 192 | ||
| 193 | (deffoo nnagent-request-group (group &optional server dont-check) | 193 | (deffoo nnagent-request-group (group &optional server dont-check info) |
| 194 | (nnoo-parent-function 'nnagent 'nnml-request-group | 194 | (nnoo-parent-function 'nnagent 'nnml-request-group |
| 195 | (list group (nnagent-server server) dont-check))) | 195 | (list group (nnagent-server server) dont-check info))) |
| 196 | 196 | ||
| 197 | (deffoo nnagent-close-group (group &optional server) | 197 | (deffoo nnagent-close-group (group &optional server) |
| 198 | (nnoo-parent-function 'nnagent 'nnml-close-group | 198 | (nnoo-parent-function 'nnagent 'nnml-close-group |
diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el index 512de38559d..8f1f6ec7bc3 100644 --- a/lisp/gnus/nnbabyl.el +++ b/lisp/gnus/nnbabyl.el | |||
| @@ -191,7 +191,7 @@ | |||
| 191 | (cons nnbabyl-current-group article) | 191 | (cons nnbabyl-current-group article) |
| 192 | (nnbabyl-article-group-number))))))) | 192 | (nnbabyl-article-group-number))))))) |
| 193 | 193 | ||
| 194 | (deffoo nnbabyl-request-group (group &optional server dont-check) | 194 | (deffoo nnbabyl-request-group (group &optional server dont-check info) |
| 195 | (let ((active (cadr (assoc group nnbabyl-group-alist)))) | 195 | (let ((active (cadr (assoc group nnbabyl-group-alist)))) |
| 196 | (save-excursion | 196 | (save-excursion |
| 197 | (cond | 197 | (cond |
diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index 790e390424e..7235e4b0332 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el | |||
| @@ -482,7 +482,7 @@ all. This may very well take some time.") | |||
| 482 | (cons (if group-num (car group-num) group) | 482 | (cons (if group-num (car group-num) group) |
| 483 | (string-to-number (file-name-nondirectory path))))))) | 483 | (string-to-number (file-name-nondirectory path))))))) |
| 484 | 484 | ||
| 485 | (deffoo nndiary-request-group (group &optional server dont-check) | 485 | (deffoo nndiary-request-group (group &optional server dont-check info) |
| 486 | (let ((file-name-coding-system nnmail-pathname-coding-system)) | 486 | (let ((file-name-coding-system nnmail-pathname-coding-system)) |
| 487 | (cond | 487 | (cond |
| 488 | ((not (nndiary-possibly-change-directory group server)) | 488 | ((not (nndiary-possibly-change-directory group server)) |
diff --git a/lisp/gnus/nndoc.el b/lisp/gnus/nndoc.el index 2e492057003..d6d455f078f 100644 --- a/lisp/gnus/nndoc.el +++ b/lisp/gnus/nndoc.el | |||
| @@ -264,7 +264,7 @@ from the document.") | |||
| 264 | (funcall nndoc-article-transform-function article)) | 264 | (funcall nndoc-article-transform-function article)) |
| 265 | t)))))) | 265 | t)))))) |
| 266 | 266 | ||
| 267 | (deffoo nndoc-request-group (group &optional server dont-check) | 267 | (deffoo nndoc-request-group (group &optional server dont-check info) |
| 268 | "Select news GROUP." | 268 | "Select news GROUP." |
| 269 | (let (number) | 269 | (let (number) |
| 270 | (cond | 270 | (cond |
diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el index e92e00efe6f..157c65da8d1 100644 --- a/lisp/gnus/nndraft.el +++ b/lisp/gnus/nndraft.el | |||
| @@ -182,7 +182,7 @@ are generated if and only if they are also in `message-draft-headers'.") | |||
| 182 | (add-hook hook 'nndraft-generate-headers nil t)) | 182 | (add-hook hook 'nndraft-generate-headers nil t)) |
| 183 | article)) | 183 | article)) |
| 184 | 184 | ||
| 185 | (deffoo nndraft-request-group (group &optional server dont-check) | 185 | (deffoo nndraft-request-group (group &optional server dont-check info) |
| 186 | (nndraft-possibly-change-group group) | 186 | (nndraft-possibly-change-group group) |
| 187 | (unless dont-check | 187 | (unless dont-check |
| 188 | (let* ((pathname (nnmail-group-pathname group nndraft-directory)) | 188 | (let* ((pathname (nnmail-group-pathname group nndraft-directory)) |
diff --git a/lisp/gnus/nneething.el b/lisp/gnus/nneething.el index bd5bfba0468..2de2dca82b9 100644 --- a/lisp/gnus/nneething.el +++ b/lisp/gnus/nneething.el | |||
| @@ -144,7 +144,7 @@ included.") | |||
| 144 | (insert "\n")) | 144 | (insert "\n")) |
| 145 | t)))) | 145 | t)))) |
| 146 | 146 | ||
| 147 | (deffoo nneething-request-group (group &optional server dont-check) | 147 | (deffoo nneething-request-group (group &optional server dont-check info) |
| 148 | (nneething-possibly-change-directory group server) | 148 | (nneething-possibly-change-directory group server) |
| 149 | (unless dont-check | 149 | (unless dont-check |
| 150 | (nneething-create-mapping) | 150 | (nneething-create-mapping) |
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el index 5cebcb0e5fc..1e0a950c40e 100644 --- a/lisp/gnus/nnfolder.el +++ b/lisp/gnus/nnfolder.el | |||
| @@ -289,7 +289,7 @@ the group. Then the marks file will be regenerated properly by Gnus.") | |||
| 289 | (point) (point-at-eol))) | 289 | (point) (point-at-eol))) |
| 290 | -1)))))))) | 290 | -1)))))))) |
| 291 | 291 | ||
| 292 | (deffoo nnfolder-request-group (group &optional server dont-check) | 292 | (deffoo nnfolder-request-group (group &optional server dont-check info) |
| 293 | (nnfolder-possibly-change-group group server t) | 293 | (nnfolder-possibly-change-group group server t) |
| 294 | (save-excursion | 294 | (save-excursion |
| 295 | (cond ((not (assoc group nnfolder-group-alist)) | 295 | (cond ((not (assoc group nnfolder-group-alist)) |
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 1fc55f6b51b..601683e5941 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -67,6 +67,9 @@ This is always done if the server supports UID EXPUNGE, but it's | |||
| 67 | not done by default on servers that doesn't support that command.") | 67 | not done by default on servers that doesn't support that command.") |
| 68 | 68 | ||
| 69 | (defvoo nnimap-connection-alist nil) | 69 | (defvoo nnimap-connection-alist nil) |
| 70 | |||
| 71 | (defvoo nnimap-current-infos nil) | ||
| 72 | |||
| 70 | (defvar nnimap-process nil) | 73 | (defvar nnimap-process nil) |
| 71 | 74 | ||
| 72 | (defvar nnimap-status-string "") | 75 | (defvar nnimap-status-string "") |
| @@ -75,7 +78,7 @@ not done by default on servers that doesn't support that command.") | |||
| 75 | "Internal variable with default value for `nnimap-split-download-body'.") | 78 | "Internal variable with default value for `nnimap-split-download-body'.") |
| 76 | 79 | ||
| 77 | (defstruct nnimap | 80 | (defstruct nnimap |
| 78 | group process commands capabilities) | 81 | group process commands capabilities select-result newlinep) |
| 79 | 82 | ||
| 80 | (defvar nnimap-object nil) | 83 | (defvar nnimap-object nil) |
| 81 | 84 | ||
| @@ -95,7 +98,7 @@ not done by default on servers that doesn't support that command.") | |||
| 95 | (defun nnimap-buffer () | 98 | (defun nnimap-buffer () |
| 96 | (nnimap-find-process-buffer nntp-server-buffer)) | 99 | (nnimap-find-process-buffer nntp-server-buffer)) |
| 97 | 100 | ||
| 98 | (defun nnimap-retrieve-headers (articles &optional group server fetch-old) | 101 | (deffoo nnimap-retrieve-headers (articles &optional group server fetch-old) |
| 99 | (with-current-buffer nntp-server-buffer | 102 | (with-current-buffer nntp-server-buffer |
| 100 | (erase-buffer) | 103 | (erase-buffer) |
| 101 | (when (nnimap-possibly-change-group group server) | 104 | (when (nnimap-possibly-change-group group server) |
| @@ -171,7 +174,7 @@ not done by default on servers that doesn't support that command.") | |||
| 171 | result)) | 174 | result)) |
| 172 | (mapconcat #'identity (nreverse result) ","))))) | 175 | (mapconcat #'identity (nreverse result) ","))))) |
| 173 | 176 | ||
| 174 | (defun nnimap-open-server (server &optional defs) | 177 | (deffoo nnimap-open-server (server &optional defs) |
| 175 | (if (nnimap-server-opened server) | 178 | (if (nnimap-server-opened server) |
| 176 | t | 179 | t |
| 177 | (unless (assq 'nnimap-address defs) | 180 | (unless (assq 'nnimap-address defs) |
| @@ -203,55 +206,69 @@ not done by default on servers that doesn't support that command.") | |||
| 203 | ?p port))))) | 206 | ?p port))))) |
| 204 | process)) | 207 | process)) |
| 205 | 208 | ||
| 209 | (defun nnimap-credentials (address ports) | ||
| 210 | (let (port credentials) | ||
| 211 | ;; Request the credentials from all ports, but only query on the | ||
| 212 | ;; last port if all the previous ones have failed. | ||
| 213 | (while (and (null credentials) | ||
| 214 | (setq port (pop ports))) | ||
| 215 | (setq credentials | ||
| 216 | (auth-source-user-or-password | ||
| 217 | '("login" "password") address port nil (null ports)))) | ||
| 218 | credentials)) | ||
| 219 | |||
| 206 | (defun nnimap-open-connection (buffer) | 220 | (defun nnimap-open-connection (buffer) |
| 207 | (with-current-buffer (nnimap-make-process-buffer buffer) | 221 | (with-current-buffer (nnimap-make-process-buffer buffer) |
| 208 | (let* ((coding-system-for-read 'binary) | 222 | (let* ((coding-system-for-read 'binary) |
| 209 | (coding-system-for-write 'binary) | 223 | (coding-system-for-write 'binary) |
| 210 | (credentials | 224 | (ports |
| 211 | (cond | 225 | (cond |
| 212 | ((eq nnimap-stream 'network) | 226 | ((eq nnimap-stream 'network) |
| 213 | (open-network-stream "*nnimap*" (current-buffer) nnimap-address | 227 | (open-network-stream |
| 214 | (or nnimap-server-port | 228 | "*nnimap*" (current-buffer) nnimap-address |
| 215 | (if (netrc-find-service-number "imap") | 229 | (or nnimap-server-port |
| 216 | "imap" | 230 | (if (netrc-find-service-number "imap") |
| 217 | "143"))) | 231 | "imap" |
| 218 | (auth-source-user-or-password | 232 | "143"))) |
| 219 | '("login" "password") nnimap-address "imap" nil t)) | 233 | '("143" "imap")) |
| 220 | ((eq nnimap-stream 'stream) | 234 | ((eq nnimap-stream 'shell) |
| 221 | (nnimap-open-shell-stream | 235 | (nnimap-open-shell-stream |
| 222 | "*nnimap*" (current-buffer) nnimap-address | 236 | "*nnimap*" (current-buffer) nnimap-address |
| 223 | (or nnimap-server-port "imap")) | 237 | (or nnimap-server-port "imap")) |
| 224 | (auth-source-user-or-password | 238 | '("imap")) |
| 225 | '("login" "password") nnimap-address "imap" nil t)) | ||
| 226 | ((eq nnimap-stream 'ssl) | 239 | ((eq nnimap-stream 'ssl) |
| 227 | (open-tls-stream "*nnimap*" (current-buffer) nnimap-address | 240 | (open-tls-stream |
| 228 | (or nnimap-server-port | 241 | "*nnimap*" (current-buffer) nnimap-address |
| 229 | (if (netrc-find-service-number "imaps") | 242 | (or nnimap-server-port |
| 230 | "imaps" | 243 | (if (netrc-find-service-number "imaps") |
| 231 | "993"))) | 244 | "imaps" |
| 232 | (or | 245 | "993"))) |
| 233 | (auth-source-user-or-password | 246 | '("143" "993" "imap" "imaps")))) |
| 234 | '("login" "password") nnimap-address "imap") | 247 | connection-result login-result credentials) |
| 235 | (auth-source-user-or-password | ||
| 236 | '("login" "password") nnimap-address "imaps" nil t)))))) | ||
| 237 | (setf (nnimap-process nnimap-object) | 248 | (setf (nnimap-process nnimap-object) |
| 238 | (get-buffer-process (current-buffer))) | 249 | (get-buffer-process (current-buffer))) |
| 239 | (unless credentials | ||
| 240 | (delete-process (nnimap-process nnimap-object))) | ||
| 241 | (when (and (nnimap-process nnimap-object) | 250 | (when (and (nnimap-process nnimap-object) |
| 242 | (memq (process-status (nnimap-process nnimap-object)) | 251 | (memq (process-status (nnimap-process nnimap-object)) |
| 243 | '(open run))) | 252 | '(open run))) |
| 244 | (gnus-set-process-query-on-exit-flag (nnimap-process nnimap-object) nil) | 253 | (gnus-set-process-query-on-exit-flag (nnimap-process nnimap-object) nil) |
| 245 | (let ((result (nnimap-command "LOGIN %S %S" | 254 | (when (setq connection-result (nnimap-wait-for-connection)) |
| 246 | (car credentials) (cadr credentials)))) | 255 | (unless (equal connection-result "PREAUTH") |
| 247 | (if (not (car result)) | 256 | (if (not (setq credentials |
| 248 | (progn | 257 | (nnimap-credentials nnimap-address ports))) |
| 258 | (setq nnimap-object nil) | ||
| 259 | (setq login-result (nnimap-command "LOGIN %S %S" | ||
| 260 | (car credentials) | ||
| 261 | (cadr credentials))) | ||
| 262 | (unless (car login-result) | ||
| 249 | (delete-process (nnimap-process nnimap-object)) | 263 | (delete-process (nnimap-process nnimap-object)) |
| 250 | nil) | 264 | (setq nnimap-object nil)))) |
| 265 | (when nnimap-object | ||
| 266 | (when (eq nnimap-stream 'shell) | ||
| 267 | (setf (nnimap-newlinep nnimap-object) t)) | ||
| 251 | (setf (nnimap-capabilities nnimap-object) | 268 | (setf (nnimap-capabilities nnimap-object) |
| 252 | (mapcar | 269 | (mapcar |
| 253 | #'upcase | 270 | #'upcase |
| 254 | (or (nnimap-find-parameter "CAPABILITY" (cdr result)) | 271 | (or (nnimap-find-parameter "CAPABILITY" (cdr login-result)) |
| 255 | (nnimap-find-parameter | 272 | (nnimap-find-parameter |
| 256 | "CAPABILITY" (cdr (nnimap-command "CAPABILITY")))))) | 273 | "CAPABILITY" (cdr (nnimap-command "CAPABILITY")))))) |
| 257 | (when (member "QRESYNC" (nnimap-capabilities nnimap-object)) | 274 | (when (member "QRESYNC" (nnimap-capabilities nnimap-object)) |
| @@ -270,22 +287,22 @@ not done by default on servers that doesn't support that command.") | |||
| 270 | (setq result (cdr (cadr elem)))))) | 287 | (setq result (cdr (cadr elem)))))) |
| 271 | result)) | 288 | result)) |
| 272 | 289 | ||
| 273 | (defun nnimap-close-server (&optional server) | 290 | (deffoo nnimap-close-server (&optional server) |
| 274 | t) | 291 | t) |
| 275 | 292 | ||
| 276 | (defun nnimap-request-close () | 293 | (deffoo nnimap-request-close () |
| 277 | t) | 294 | t) |
| 278 | 295 | ||
| 279 | (defun nnimap-server-opened (&optional server) | 296 | (deffoo nnimap-server-opened (&optional server) |
| 280 | (and (nnoo-current-server-p 'nnimap server) | 297 | (and (nnoo-current-server-p 'nnimap server) |
| 281 | nntp-server-buffer | 298 | nntp-server-buffer |
| 282 | (gnus-buffer-live-p nntp-server-buffer) | 299 | (gnus-buffer-live-p nntp-server-buffer) |
| 283 | (nnimap-find-connection nntp-server-buffer))) | 300 | (nnimap-find-connection nntp-server-buffer))) |
| 284 | 301 | ||
| 285 | (defun nnimap-status-message (&optional server) | 302 | (deffoo nnimap-status-message (&optional server) |
| 286 | nnimap-status-string) | 303 | nnimap-status-string) |
| 287 | 304 | ||
| 288 | (defun nnimap-request-article (article &optional group server to-buffer) | 305 | (deffoo nnimap-request-article (article &optional group server to-buffer) |
| 289 | (with-current-buffer nntp-server-buffer | 306 | (with-current-buffer nntp-server-buffer |
| 290 | (let ((result (nnimap-possibly-change-group group server))) | 307 | (let ((result (nnimap-possibly-change-group group server))) |
| 291 | (when (stringp article) | 308 | (when (stringp article) |
| @@ -314,21 +331,46 @@ not done by default on servers that doesn't support that command.") | |||
| 314 | (nnheader-ms-strip-cr)) | 331 | (nnheader-ms-strip-cr)) |
| 315 | t))))))) | 332 | t))))))) |
| 316 | 333 | ||
| 317 | (defun nnimap-request-group (group &optional server dont-check) | 334 | (deffoo nnimap-request-group (group &optional server dont-check info) |
| 318 | (with-current-buffer nntp-server-buffer | 335 | (with-current-buffer nntp-server-buffer |
| 319 | (let ((result (nnimap-possibly-change-group group server)) | 336 | (let ((result (nnimap-possibly-change-group group server)) |
| 320 | articles) | 337 | articles active marks high low) |
| 321 | (when result | 338 | (when result |
| 322 | (setq articles (nnimap-get-flags "1:*")) | 339 | (if (and dont-check |
| 323 | (erase-buffer) | 340 | (setq active (nth 2 (assoc group nnimap-current-infos)))) |
| 324 | (insert | 341 | (insert (format "211 %d %d %d %S\n" |
| 325 | (format | 342 | (- (cdr active) (car active)) |
| 326 | "211 %d %d %d %S\n" | 343 | (car active) |
| 327 | (length articles) | 344 | (cdr active) |
| 328 | (or (caar articles) 0) | 345 | group)) |
| 329 | (or (caar (last articles)) 0) | 346 | (with-current-buffer (nnimap-buffer) |
| 330 | group)) | 347 | (erase-buffer) |
| 331 | t)))) | 348 | (let ((group-sequence |
| 349 | (nnimap-send-command "SELECT %S" (utf7-encode group))) | ||
| 350 | (flag-sequence | ||
| 351 | (nnimap-send-command "UID FETCH 1:* FLAGS"))) | ||
| 352 | (nnimap-wait-for-response flag-sequence) | ||
| 353 | (setq marks | ||
| 354 | (nnimap-flags-to-marks | ||
| 355 | (nnimap-parse-flags | ||
| 356 | (list (list group-sequence flag-sequence 1 group))))) | ||
| 357 | (when info | ||
| 358 | (nnimap-update-infos marks (list info))) | ||
| 359 | (goto-char (point-max)) | ||
| 360 | (cond | ||
| 361 | (marks | ||
| 362 | (setq high (nth 3 (car marks)) | ||
| 363 | low (nth 4 (car marks)))) | ||
| 364 | ((re-search-backward "UIDNEXT \\([0-9]+\\)" nil t) | ||
| 365 | (setq high (string-to-number (match-string 1)) | ||
| 366 | low 1))))) | ||
| 367 | (erase-buffer) | ||
| 368 | (insert | ||
| 369 | (format | ||
| 370 | "211 %d %d %d %S\n" | ||
| 371 | (1+ (- high low)) | ||
| 372 | low high group)))) | ||
| 373 | t))) | ||
| 332 | 374 | ||
| 333 | (defun nnimap-get-flags (spec) | 375 | (defun nnimap-get-flags (spec) |
| 334 | (let ((articles nil) | 376 | (let ((articles nil) |
| @@ -345,7 +387,7 @@ not done by default on servers that doesn't support that command.") | |||
| 345 | articles))) | 387 | articles))) |
| 346 | (nreverse articles))) | 388 | (nreverse articles))) |
| 347 | 389 | ||
| 348 | (defun nnimap-close-group (group &optional server) | 390 | (deffoo nnimap-close-group (group &optional server) |
| 349 | t) | 391 | t) |
| 350 | 392 | ||
| 351 | (deffoo nnimap-request-move-article (article group server accept-form | 393 | (deffoo nnimap-request-move-article (article group server accept-form |
| @@ -417,7 +459,7 @@ not done by default on servers that doesn't support that command.") | |||
| 417 | (push flag flags))) | 459 | (push flag flags))) |
| 418 | flags)) | 460 | flags)) |
| 419 | 461 | ||
| 420 | (defun nnimap-request-set-mark (group actions &optional server) | 462 | (deffoo nnimap-request-set-mark (group actions &optional server) |
| 421 | (when (nnimap-possibly-change-group group server) | 463 | (when (nnimap-possibly-change-group group server) |
| 422 | (let (sequence) | 464 | (let (sequence) |
| 423 | (with-current-buffer (nnimap-buffer) | 465 | (with-current-buffer (nnimap-buffer) |
| @@ -449,7 +491,10 @@ not done by default on servers that doesn't support that command.") | |||
| 449 | "APPEND %S {%d}" (utf7-encode group t) | 491 | "APPEND %S {%d}" (utf7-encode group t) |
| 450 | (length message))) | 492 | (length message))) |
| 451 | (process-send-string (get-buffer-process (current-buffer)) message) | 493 | (process-send-string (get-buffer-process (current-buffer)) message) |
| 452 | (process-send-string (get-buffer-process (current-buffer)) "\r\n") | 494 | (process-send-string (get-buffer-process (current-buffer)) |
| 495 | (if (nnimap-newlinep nnimap-object) | ||
| 496 | "\n" | ||
| 497 | "\r\n")) | ||
| 453 | (let ((result (nnimap-get-response sequence))) | 498 | (let ((result (nnimap-get-response sequence))) |
| 454 | (when result | 499 | (when result |
| 455 | (cons group | 500 | (cons group |
| @@ -471,7 +516,7 @@ not done by default on servers that doesn't support that command.") | |||
| 471 | (push (car (last line)) groups))) | 516 | (push (car (last line)) groups))) |
| 472 | (nreverse groups)))) | 517 | (nreverse groups)))) |
| 473 | 518 | ||
| 474 | (defun nnimap-request-list (&optional server) | 519 | (deffoo nnimap-request-list (&optional server) |
| 475 | (nnimap-possibly-change-group nil server) | 520 | (nnimap-possibly-change-group nil server) |
| 476 | (with-current-buffer nntp-server-buffer | 521 | (with-current-buffer nntp-server-buffer |
| 477 | (erase-buffer) | 522 | (erase-buffer) |
| @@ -514,7 +559,7 @@ not done by default on servers that doesn't support that command.") | |||
| 514 | (or highest exists))))))))) | 559 | (or highest exists))))))))) |
| 515 | t)))) | 560 | t)))) |
| 516 | 561 | ||
| 517 | (defun nnimap-retrieve-group-data-early (server infos) | 562 | (deffoo nnimap-retrieve-group-data-early (server infos) |
| 518 | (when (nnimap-possibly-change-group nil server) | 563 | (when (nnimap-possibly-change-group nil server) |
| 519 | (with-current-buffer (nnimap-buffer) | 564 | (with-current-buffer (nnimap-buffer) |
| 520 | ;; QRESYNC handling isn't implemented. | 565 | ;; QRESYNC handling isn't implemented. |
| @@ -554,7 +599,7 @@ not done by default on servers that doesn't support that command.") | |||
| 554 | sequences)))) | 599 | sequences)))) |
| 555 | sequences)))) | 600 | sequences)))) |
| 556 | 601 | ||
| 557 | (defun nnimap-finish-retrieve-group-infos (server infos sequences) | 602 | (deffoo nnimap-finish-retrieve-group-infos (server infos sequences) |
| 558 | (when (and sequences | 603 | (when (and sequences |
| 559 | (nnimap-possibly-change-group nil server)) | 604 | (nnimap-possibly-change-group nil server)) |
| 560 | (with-current-buffer (nnimap-buffer) | 605 | (with-current-buffer (nnimap-buffer) |
| @@ -601,9 +646,11 @@ not done by default on servers that doesn't support that command.") | |||
| 601 | (when (> start-article 1) | 646 | (when (> start-article 1) |
| 602 | (setq read | 647 | (setq read |
| 603 | (gnus-range-nconcat | 648 | (gnus-range-nconcat |
| 604 | (gnus-sorted-range-intersection | 649 | (if (> start-article 1) |
| 605 | (cons 1 start-article) | 650 | (gnus-sorted-range-intersection |
| 606 | (gnus-info-read info)) | 651 | (cons 1 (1- start-article)) |
| 652 | (gnus-info-read info)) | ||
| 653 | (gnus-info-read info)) | ||
| 607 | read))) | 654 | read))) |
| 608 | (gnus-info-set-read info read) | 655 | (gnus-info-set-read info read) |
| 609 | ;; Update the marks. | 656 | ;; Update the marks. |
| @@ -622,12 +669,20 @@ not done by default on servers that doesn't support that command.") | |||
| 622 | (when (and old-marks | 669 | (when (and old-marks |
| 623 | (> start-article 1)) | 670 | (> start-article 1)) |
| 624 | (setq old-marks (gnus-range-difference | 671 | (setq old-marks (gnus-range-difference |
| 625 | (cons start-article high) | 672 | old-marks |
| 626 | old-marks)) | 673 | (cons start-article high))) |
| 627 | (setq new-marks (gnus-range-nconcat old-marks new-marks))) | 674 | (setq new-marks (gnus-range-nconcat old-marks new-marks))) |
| 628 | (when new-marks | 675 | (when new-marks |
| 629 | (push (cons (car type) new-marks) marks))) | 676 | (push (cons (car type) new-marks) marks))) |
| 630 | (gnus-info-set-marks info marks))))))) | 677 | (gnus-info-set-marks info marks t) |
| 678 | (nnimap-store-info info (gnus-active group)))))))) | ||
| 679 | |||
| 680 | (defun nnimap-store-info (info active) | ||
| 681 | (let* ((group (gnus-group-real-name (gnus-info-group info))) | ||
| 682 | (entry (assoc group nnimap-current-infos))) | ||
| 683 | (if entry | ||
| 684 | (setcdr entry (list info active)) | ||
| 685 | (push (list group info active) nnimap-current-infos)))) | ||
| 631 | 686 | ||
| 632 | (defun nnimap-flags-to-marks (groups) | 687 | (defun nnimap-flags-to-marks (groups) |
| 633 | (let (data group totalp uidnext articles start-article mark) | 688 | (let (data group totalp uidnext articles start-article mark) |
| @@ -681,7 +736,7 @@ not done by default on servers that doesn't support that command.") | |||
| 681 | (defun nnimap-find-process-buffer (buffer) | 736 | (defun nnimap-find-process-buffer (buffer) |
| 682 | (cadr (assoc buffer nnimap-connection-alist))) | 737 | (cadr (assoc buffer nnimap-connection-alist))) |
| 683 | 738 | ||
| 684 | (defun nnimap-request-post (&optional server) | 739 | (deffoo nnimap-request-post (&optional server) |
| 685 | (setq nnimap-status-string "Read-only server") | 740 | (setq nnimap-status-string "Read-only server") |
| 686 | nil) | 741 | nil) |
| 687 | 742 | ||
| @@ -701,7 +756,8 @@ not done by default on servers that doesn't support that command.") | |||
| 701 | t | 756 | t |
| 702 | (let ((result (nnimap-command "SELECT %S" (utf7-encode group t)))) | 757 | (let ((result (nnimap-command "SELECT %S" (utf7-encode group t)))) |
| 703 | (when (car result) | 758 | (when (car result) |
| 704 | (setf (nnimap-group nnimap-object) group) | 759 | (setf (nnimap-group nnimap-object) group |
| 760 | (nnimap-select-result nnimap-object) result) | ||
| 705 | result)))))))) | 761 | result)))))))) |
| 706 | 762 | ||
| 707 | (defun nnimap-find-connection (buffer) | 763 | (defun nnimap-find-connection (buffer) |
| @@ -722,9 +778,12 @@ not done by default on servers that doesn't support that command.") | |||
| 722 | (process-send-string | 778 | (process-send-string |
| 723 | (get-buffer-process (current-buffer)) | 779 | (get-buffer-process (current-buffer)) |
| 724 | (nnimap-log-command | 780 | (nnimap-log-command |
| 725 | (format "%d %s\r\n" | 781 | (format "%d %s%s\n" |
| 726 | (incf nnimap-sequence) | 782 | (incf nnimap-sequence) |
| 727 | (apply #'format args)))) | 783 | (apply #'format args) |
| 784 | (if (nnimap-newlinep nnimap-object) | ||
| 785 | "" | ||
| 786 | "\r")))) | ||
| 728 | nnimap-sequence) | 787 | nnimap-sequence) |
| 729 | 788 | ||
| 730 | (defun nnimap-log-command (command) | 789 | (defun nnimap-log-command (command) |
| @@ -747,12 +806,22 @@ not done by default on servers that doesn't support that command.") | |||
| 747 | (nnimap-wait-for-response sequence) | 806 | (nnimap-wait-for-response sequence) |
| 748 | (nnimap-parse-response)) | 807 | (nnimap-parse-response)) |
| 749 | 808 | ||
| 809 | (defun nnimap-wait-for-connection () | ||
| 810 | (let ((process (get-buffer-process (current-buffer)))) | ||
| 811 | (goto-char (point-min)) | ||
| 812 | (while (and (memq (process-status process) | ||
| 813 | '(open run)) | ||
| 814 | (not (re-search-forward "^\\* " nil t))) | ||
| 815 | (nnheader-accept-process-output process) | ||
| 816 | (goto-char (point-min))) | ||
| 817 | (and (looking-at "[A-Z0-9]+") | ||
| 818 | (match-string 0)))) | ||
| 819 | |||
| 750 | (defun nnimap-wait-for-response (sequence &optional messagep) | 820 | (defun nnimap-wait-for-response (sequence &optional messagep) |
| 751 | (goto-char (point-max)) | 821 | (goto-char (point-max)) |
| 752 | (while (or (bobp) | 822 | (while (not (re-search-backward (format "^%d .*\n" sequence) |
| 753 | (progn | 823 | (max (point-min) (- (point) 500)) |
| 754 | (forward-line -1) | 824 | t)) |
| 755 | (not (looking-at (format "^%d .*\n" sequence))))) | ||
| 756 | (when messagep | 825 | (when messagep |
| 757 | (message "Read %dKB" (/ (buffer-size) 1000))) | 826 | (message "Read %dKB" (/ (buffer-size) 1000))) |
| 758 | (nnheader-accept-process-output (get-buffer-process (current-buffer))) | 827 | (nnheader-accept-process-output (get-buffer-process (current-buffer))) |
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 27610e7aba2..a826b5be791 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el | |||
| @@ -733,7 +733,7 @@ and show thread that contains this article." | |||
| 733 | ;; Just set the server variables appropriately. | 733 | ;; Just set the server variables appropriately. |
| 734 | (nnoo-change-server 'nnir server definitions)) | 734 | (nnoo-change-server 'nnir server definitions)) |
| 735 | 735 | ||
| 736 | (deffoo nnir-request-group (group &optional server fast) | 736 | (deffoo nnir-request-group (group &optional server fast info) |
| 737 | "GROUP is the query string." | 737 | "GROUP is the query string." |
| 738 | (nnir-possibly-change-server server) | 738 | (nnir-possibly-change-server server) |
| 739 | ;; Check for cache and return that if appropriate. | 739 | ;; Check for cache and return that if appropriate. |
diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index b79e7103cef..5b50ddb4b99 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el | |||
| @@ -983,7 +983,7 @@ by nnmaildir-request-article.") | |||
| 983 | (setf (nnmaildir--grp-mmth group) new-mmth) | 983 | (setf (nnmaildir--grp-mmth group) new-mmth) |
| 984 | info))) | 984 | info))) |
| 985 | 985 | ||
| 986 | (defun nnmaildir-request-group (gname &optional server fast) | 986 | (defun nnmaildir-request-group (gname &optional server fast info) |
| 987 | (let ((group (nnmaildir--prepare server gname)) | 987 | (let ((group (nnmaildir--prepare server gname)) |
| 988 | deactivate-mark) | 988 | deactivate-mark) |
| 989 | (catch 'return | 989 | (catch 'return |
diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el index b43a83e3a33..26d95b21eb3 100644 --- a/lisp/gnus/nnmairix.el +++ b/lisp/gnus/nnmairix.el | |||
| @@ -424,7 +424,7 @@ Other back ends might or might not work.") | |||
| 424 | (setq nnmairix-current-server server) | 424 | (setq nnmairix-current-server server) |
| 425 | (nnoo-change-server 'nnmairix server definitions)) | 425 | (nnoo-change-server 'nnmairix server definitions)) |
| 426 | 426 | ||
| 427 | (deffoo nnmairix-request-group (group &optional server fast) | 427 | (deffoo nnmairix-request-group (group &optional server fast info) |
| 428 | ;; Call mairix and request group on back end server | 428 | ;; Call mairix and request group on back end server |
| 429 | (when server (nnmairix-open-server server)) | 429 | (when server (nnmairix-open-server server)) |
| 430 | (let* ((qualgroup (if server | 430 | (let* ((qualgroup (if server |
diff --git a/lisp/gnus/nnmbox.el b/lisp/gnus/nnmbox.el index 4b01bfa5c6e..bc5c01e51ad 100644 --- a/lisp/gnus/nnmbox.el +++ b/lisp/gnus/nnmbox.el | |||
| @@ -172,7 +172,7 @@ | |||
| 172 | (cons nnmbox-current-group article) | 172 | (cons nnmbox-current-group article) |
| 173 | (nnmbox-article-group-number nil))))))) | 173 | (nnmbox-article-group-number nil))))))) |
| 174 | 174 | ||
| 175 | (deffoo nnmbox-request-group (group &optional server dont-check) | 175 | (deffoo nnmbox-request-group (group &optional server dont-check info) |
| 176 | (nnmbox-possibly-change-newsgroup nil server) | 176 | (nnmbox-possibly-change-newsgroup nil server) |
| 177 | (let ((active (cadr (assoc group nnmbox-group-alist)))) | 177 | (let ((active (cadr (assoc group nnmbox-group-alist)))) |
| 178 | (cond | 178 | (cond |
diff --git a/lisp/gnus/nnmh.el b/lisp/gnus/nnmh.el index 131861e03ec..cdd540a993b 100644 --- a/lisp/gnus/nnmh.el +++ b/lisp/gnus/nnmh.el | |||
| @@ -149,7 +149,7 @@ as unread by Gnus.") | |||
| 149 | (save-excursion (nnmail-find-file file)) | 149 | (save-excursion (nnmail-find-file file)) |
| 150 | (string-to-number (file-name-nondirectory file))))) | 150 | (string-to-number (file-name-nondirectory file))))) |
| 151 | 151 | ||
| 152 | (deffoo nnmh-request-group (group &optional server dont-check) | 152 | (deffoo nnmh-request-group (group &optional server dont-check info) |
| 153 | (nnheader-init-server-buffer) | 153 | (nnheader-init-server-buffer) |
| 154 | (nnmh-possibly-change-directory group server) | 154 | (nnmh-possibly-change-directory group server) |
| 155 | (let ((pathname (nnmail-group-pathname group nnmh-directory)) | 155 | (let ((pathname (nnmail-group-pathname group nnmh-directory)) |
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el index 5d62192819e..8fca41eb4d2 100644 --- a/lisp/gnus/nnml.el +++ b/lisp/gnus/nnml.el | |||
| @@ -254,7 +254,7 @@ non-nil.") | |||
| 254 | (cons (if group-num (car group-num) group) | 254 | (cons (if group-num (car group-num) group) |
| 255 | (string-to-number (file-name-nondirectory path))))))) | 255 | (string-to-number (file-name-nondirectory path))))))) |
| 256 | 256 | ||
| 257 | (deffoo nnml-request-group (group &optional server dont-check) | 257 | (deffoo nnml-request-group (group &optional server dont-check info) |
| 258 | (let ((file-name-coding-system nnmail-pathname-coding-system) | 258 | (let ((file-name-coding-system nnmail-pathname-coding-system) |
| 259 | (decoded (nnml-decoded-group-name group server))) | 259 | (decoded (nnml-decoded-group-name group server))) |
| 260 | (cond | 260 | (cond |
diff --git a/lisp/gnus/nnnil.el b/lisp/gnus/nnnil.el index dd5e9841c15..e40126d6e0d 100644 --- a/lisp/gnus/nnnil.el +++ b/lisp/gnus/nnnil.el | |||
| @@ -56,7 +56,7 @@ | |||
| 56 | (setq nnnil-status-string "No such group") | 56 | (setq nnnil-status-string "No such group") |
| 57 | nil) | 57 | nil) |
| 58 | 58 | ||
| 59 | (defun nnnil-request-group (group &optional server fast) | 59 | (defun nnnil-request-group (group &optional server fast info) |
| 60 | (let (deactivate-mark) | 60 | (let (deactivate-mark) |
| 61 | (with-current-buffer nntp-server-buffer | 61 | (with-current-buffer nntp-server-buffer |
| 62 | (erase-buffer) | 62 | (erase-buffer) |
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index f241e5b175b..f93d811068d 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el | |||
| @@ -178,7 +178,7 @@ used to render text. If it is nil, text will simply be folded.") | |||
| 178 | "\n"))))) | 178 | "\n"))))) |
| 179 | 'nov) | 179 | 'nov) |
| 180 | 180 | ||
| 181 | (deffoo nnrss-request-group (group &optional server dont-check) | 181 | (deffoo nnrss-request-group (group &optional server dont-check info) |
| 182 | (setq group (nnrss-decode-group-name group)) | 182 | (setq group (nnrss-decode-group-name group)) |
| 183 | (nnheader-message 6 "nnrss: Requesting %s..." group) | 183 | (nnheader-message 6 "nnrss: Requesting %s..." group) |
| 184 | (nnrss-possibly-change-group group server) | 184 | (nnrss-possibly-change-group group server) |
diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el index ee1e36f55c7..35987277b3d 100644 --- a/lisp/gnus/nnspool.el +++ b/lisp/gnus/nnspool.el | |||
| @@ -226,7 +226,7 @@ there.") | |||
| 226 | (nnheader-fold-continuation-lines))) | 226 | (nnheader-fold-continuation-lines))) |
| 227 | res)) | 227 | res)) |
| 228 | 228 | ||
| 229 | (deffoo nnspool-request-group (group &optional server dont-check) | 229 | (deffoo nnspool-request-group (group &optional server dont-check info) |
| 230 | "Select news GROUP." | 230 | "Select news GROUP." |
| 231 | (let ((pathname (nnspool-article-pathname group)) | 231 | (let ((pathname (nnspool-article-pathname group)) |
| 232 | dir) | 232 | dir) |
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index 59f803d8c6a..50f11ad24f7 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el | |||
| @@ -987,7 +987,7 @@ command whose response triggered the error." | |||
| 987 | "\r?\n\\.\r?\n" "BODY" | 987 | "\r?\n\\.\r?\n" "BODY" |
| 988 | (if (numberp article) (int-to-string article) article)))) | 988 | (if (numberp article) (int-to-string article) article)))) |
| 989 | 989 | ||
| 990 | (deffoo nntp-request-group (group &optional server dont-check) | 990 | (deffoo nntp-request-group (group &optional server dont-check info) |
| 991 | (nntp-with-open-group | 991 | (nntp-with-open-group |
| 992 | nil server | 992 | nil server |
| 993 | (when (nntp-send-command "^[245].*\n" "GROUP" group) | 993 | (when (nntp-send-command "^[245].*\n" "GROUP" group) |
diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el index 18faa23a80e..88ff852e854 100644 --- a/lisp/gnus/nnvirtual.el +++ b/lisp/gnus/nnvirtual.el | |||
| @@ -247,7 +247,7 @@ component group will show up when you enter the virtual group.") | |||
| 247 | t))) | 247 | t))) |
| 248 | 248 | ||
| 249 | 249 | ||
| 250 | (deffoo nnvirtual-request-group (group &optional server dont-check) | 250 | (deffoo nnvirtual-request-group (group &optional server dont-check info) |
| 251 | (nnvirtual-possibly-change-server server) | 251 | (nnvirtual-possibly-change-server server) |
| 252 | (setq nnvirtual-component-groups | 252 | (setq nnvirtual-component-groups |
| 253 | (delete (nnvirtual-current-group) nnvirtual-component-groups)) | 253 | (delete (nnvirtual-current-group) nnvirtual-component-groups)) |
diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index e6289c57bca..fceb2a387aa 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el | |||
| @@ -124,7 +124,7 @@ Valid types include `google', `dejanews', and `gmane'.") | |||
| 124 | (nnweb-write-active) | 124 | (nnweb-write-active) |
| 125 | (nnweb-write-overview group))) | 125 | (nnweb-write-overview group))) |
| 126 | 126 | ||
| 127 | (deffoo nnweb-request-group (group &optional server dont-check) | 127 | (deffoo nnweb-request-group (group &optional server dont-check info) |
| 128 | (nnweb-possibly-change-server group server) | 128 | (nnweb-possibly-change-server group server) |
| 129 | (unless (or nnweb-ephemeral-p | 129 | (unless (or nnweb-ephemeral-p |
| 130 | dont-check | 130 | dont-check |