aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2010-09-19 10:45:51 +0000
committerKatsumi Yamaoka2010-09-19 10:45:51 +0000
commite8861cd2e44567ee08ffe0933e961eda16918c59 (patch)
tree86ef54f207471ea471ba92b0d5d1af495227b6ec
parente2c3f530ff6fff5f5276ebc4db1e93a967eca351 (diff)
downloademacs-e8861cd2e44567ee08ffe0933e961eda16918c59.tar.gz
emacs-e8861cd2e44567ee08ffe0933e961eda16918c59.zip
Merge changes made in Gnus trunk.
nnimap.el (nnimap-finish-retrieve-group-infos): Return data in the nntp buffer so the agent can save it. nnimap.el (nnimap-open-shell-stream): Bind `process-connection-type' to nil, so that CRLF doesn't get translated to \n; (nnimap-open-connection): Don't make 'shell commands only send \n. nnimap.el (nnimap-request-group): Don't make `M-g' bug out on group with no marks. gnus-agent.el (gnus-agent-load-alist): Nix out the alist if the file doesn't exist. nnimap.el (nnimap-finish-retrieve-group-infos): Protect against groups that have no articles. nnimap.el (nnimap-request-article): Check that we really got an article when we requested one. gnus-html.el (gnus-html-schedule-image-fetching): Ignore all errors from url-retrieve, for instance about invalid URLs. gnus-agent.el: Change default of gnus-agent-auto-agentize-methods to nil.
-rw-r--r--lisp/gnus/ChangeLog23
-rw-r--r--lisp/gnus/gnus-agent.el15
-rw-r--r--lisp/gnus/gnus-html.el7
-rw-r--r--lisp/gnus/gnus-start.el3
-rw-r--r--lisp/gnus/nnimap.el40
5 files changed, 63 insertions, 25 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index e82b213747b..e652d5462a2 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,26 @@
12010-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus-agent.el (gnus-agent-auto-agentize-methods): Switch the default
4 to nil, so that no methods are automatically agentized. I think this
5 is probably what most users want.
6
7 * gnus-html.el (gnus-html-schedule-image-fetching): Ignore all errors
8 from url-retrieve, for instance about invalid URLs.
9
10 * nnimap.el (nnimap-finish-retrieve-group-infos): Protect against
11 groups that have no articles.
12 (nnimap-request-article): Check that we really got an article when we
13 requested one.
14
15 * gnus-agent.el (gnus-agent-load-alist): Nix out the alist if the file
16 doesn't exist.
17
18 * nnimap.el (nnimap-finish-retrieve-group-infos): Return data in the
19 nntp buffer so the agent can save it.
20 (nnimap-open-shell-stream): Bind `process-connection-type' to nil, so
21 that CRLF doesn't get translated to \n.
22 (nnimap-open-connection): Don't make 'shell commands only send \n.
23
12010-09-19 Stefan Monnier <monnier@iro.umontreal.ca> 242010-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
2 25
3 * nnml.el (nnml-files): Add prefix to dynamic var `files'. 26 * nnml.el (nnml-files): Add prefix to dynamic var `files'.
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 6dcc77cdfb9..781ea3b1a53 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -184,7 +184,7 @@ When found, offer to remove them."
184 :type 'boolean 184 :type 'boolean
185 :group 'gnus-agent) 185 :group 'gnus-agent)
186 186
187(defcustom gnus-agent-auto-agentize-methods '(nntp) 187(defcustom gnus-agent-auto-agentize-methods nil
188 "Initially, all servers from these methods are agentized. 188 "Initially, all servers from these methods are agentized.
189The user may remove or add servers using the Server buffer. 189The user may remove or add servers using the Server buffer.
190See Info node `(gnus)Server Buffer'." 190See Info node `(gnus)Server Buffer'."
@@ -2104,12 +2104,12 @@ doesn't exist, to valid the overview buffer."
2104 (let* ((gnus-agent-read-agentview group) 2104 (let* ((gnus-agent-read-agentview group)
2105 (file-name-coding-system nnmail-pathname-coding-system) 2105 (file-name-coding-system nnmail-pathname-coding-system)
2106 (agentview (gnus-agent-article-name ".agentview" group))) 2106 (agentview (gnus-agent-article-name ".agentview" group)))
2107 (when (file-exists-p agentview) 2107 (setq gnus-agent-article-alist
2108 (setq gnus-agent-article-alist 2108 (and (file-exists-p agentview)
2109 (gnus-cache-file-contents 2109 (gnus-cache-file-contents
2110 agentview 2110 agentview
2111 'gnus-agent-file-loading-cache 2111 'gnus-agent-file-loading-cache
2112 'gnus-agent-read-agentview))))) 2112 'gnus-agent-read-agentview)))))
2113 2113
2114(defun gnus-agent-read-agentview (file) 2114(defun gnus-agent-read-agentview (file)
2115 "Load FILE and do a `read' there." 2115 "Load FILE and do a `read' there."
@@ -2353,7 +2353,6 @@ modified) original contents, they are first saved to their own file."
2353 (local (or local (gnus-agent-load-local))) 2353 (local (or local (gnus-agent-load-local)))
2354 (symb (intern gmane local)) 2354 (symb (intern gmane local))
2355 (minmax (and (boundp symb) (symbol-value symb)))) 2355 (minmax (and (boundp symb) (symbol-value symb))))
2356
2357 (if (cond ((and minmax 2356 (if (cond ((and minmax
2358 (or (not (eq min (car minmax))) 2357 (or (not (eq min (car minmax)))
2359 (not (eq max (cdr minmax)))) 2358 (not (eq max (cdr minmax))))
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index b2ecb5cdf68..d3e8c48f440 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -298,9 +298,10 @@ fit these criteria."
298 (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"
299 buffer images) 299 buffer images)
300 (dolist (image images) 300 (dolist (image images)
301 (url-retrieve (car image) 301 (ignore-errors
302 'gnus-html-image-fetched 302 (url-retrieve (car image)
303 (list buffer image)))) 303 'gnus-html-image-fetched
304 (list buffer image)))))
304 305
305(defun gnus-html-image-id (url) 306(defun gnus-html-image-id (url)
306 (expand-file-name (sha1 url) gnus-html-cache-directory)) 307 (expand-file-name (sha1 url) gnus-html-cache-directory))
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index b421ceed6e5..18553071bf0 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -1808,7 +1808,8 @@ If SCAN, request a scan of that group as well."
1808 (gnus-check-backend-function 'finish-retrieve-group-infos (car method)) 1808 (gnus-check-backend-function 'finish-retrieve-group-infos (car method))
1809 (or (not (gnus-agent-method-p method)) 1809 (or (not (gnus-agent-method-p method))
1810 (gnus-online method))) 1810 (gnus-online method)))
1811 (gnus-finish-retrieve-group-infos method infos early-data)) 1811 (gnus-finish-retrieve-group-infos method infos early-data)
1812 (gnus-agent-save-active method))
1812 ((gnus-check-backend-function 'retrieve-groups (car method)) 1813 ((gnus-check-backend-function 'retrieve-groups (car method))
1813 (when (gnus-check-backend-function 'request-scan (car method)) 1814 (when (gnus-check-backend-function 'request-scan (car method))
1814 (dolist (info infos) 1815 (dolist (info infos)
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 601683e5941..c27b3ec776b 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -197,14 +197,14 @@ not done by default on servers that doesn't support that command.")
197 (current-buffer))) 197 (current-buffer)))
198 198
199(defun nnimap-open-shell-stream (name buffer host port) 199(defun nnimap-open-shell-stream (name buffer host port)
200 (let ((process (start-process name buffer shell-file-name 200 (let ((process-connection-type nil))
201 shell-command-switch 201 (start-process name buffer shell-file-name
202 (format-spec 202 shell-command-switch
203 nnimap-shell-program 203 (format-spec
204 (format-spec-make 204 nnimap-shell-program
205 ?s host 205 (format-spec-make
206 ?p port))))) 206 ?s host
207 process)) 207 ?p port)))))
208 208
209(defun nnimap-credentials (address ports) 209(defun nnimap-credentials (address ports)
210 (let (port credentials) 210 (let (port credentials)
@@ -263,8 +263,6 @@ not done by default on servers that doesn't support that command.")
263 (delete-process (nnimap-process nnimap-object)) 263 (delete-process (nnimap-process nnimap-object))
264 (setq nnimap-object nil)))) 264 (setq nnimap-object nil))))
265 (when nnimap-object 265 (when nnimap-object
266 (when (eq nnimap-stream 'shell)
267 (setf (nnimap-newlinep nnimap-object) t))
268 (setf (nnimap-capabilities nnimap-object) 266 (setf (nnimap-capabilities nnimap-object)
269 (mapcar 267 (mapcar
270 #'upcase 268 #'upcase
@@ -317,10 +315,14 @@ not done by default on servers that doesn't support that command.")
317 (if (member "IMAP4REV1" (nnimap-capabilities nnimap-object)) 315 (if (member "IMAP4REV1" (nnimap-capabilities nnimap-object))
318 "UID FETCH %d BODY.PEEK[]" 316 "UID FETCH %d BODY.PEEK[]"
319 "UID FETCH %d RFC822.PEEK") 317 "UID FETCH %d RFC822.PEEK")
320 article))) 318 article))
319 ;; Check that we really got an article.
320 (goto-char (point-min))
321 (unless (looking-at "\\* [0-9]+ FETCH")
322 (setq result nil)))
321 (let ((buffer (nnimap-find-process-buffer (current-buffer)))) 323 (let ((buffer (nnimap-find-process-buffer (current-buffer))))
322 (when (car result) 324 (when (car result)
323 (with-current-buffer to-buffer 325 (with-current-buffer (or to-buffer nntp-server-buffer)
324 (insert-buffer-substring buffer) 326 (insert-buffer-substring buffer)
325 (goto-char (point-min)) 327 (goto-char (point-min))
326 (let ((bytes (nnimap-get-length))) 328 (let ((bytes (nnimap-get-length)))
@@ -611,7 +613,19 @@ not done by default on servers that doesn't support that command.")
611 (nnimap-update-infos (nnimap-flags-to-marks 613 (nnimap-update-infos (nnimap-flags-to-marks
612 (nnimap-parse-flags 614 (nnimap-parse-flags
613 (nreverse sequences))) 615 (nreverse sequences)))
614 infos)))) 616 infos)
617 ;; Finally, just return something resembling an active file in
618 ;; the nntp buffer, so that the agent can save the info, too.
619 (with-current-buffer nntp-server-buffer
620 (erase-buffer)
621 (dolist (info infos)
622 (let* ((group (gnus-info-group info))
623 (active (gnus-active group)))
624 (when active
625 (insert (format "%S %d %d y\n"
626 (gnus-group-real-name group)
627 (cdr active)
628 (car active))))))))))
615 629
616(defun nnimap-update-infos (flags infos) 630(defun nnimap-update-infos (flags infos)
617 (dolist (info infos) 631 (dolist (info infos)