diff options
| author | Lars Ingebrigtsen | 2014-03-07 16:00:34 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2014-03-07 16:00:34 +0100 |
| commit | 84254bbdf069f0386f188d0e2bc5be795a9272bb (patch) | |
| tree | 8232e1bffb4e197a104741570615780e9cd127a7 | |
| parent | 162427fe6a9fbcd9f4b8f747d8469577951a1b00 (diff) | |
| download | emacs-84254bbdf069f0386f188d0e2bc5be795a9272bb.tar.gz emacs-84254bbdf069f0386f188d0e2bc5be795a9272bb.zip | |
* gnus-agent.el (gnus-agent-update-files-total-fetched-for): Don't bug out
if the directory doesn't exist.
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-agent.el | 44 |
2 files changed, 28 insertions, 21 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 76c358c38d4..dd66afc34c4 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-03-07 Lars Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * gnus-agent.el (gnus-agent-update-files-total-fetched-for): Don't bug | ||
| 4 | out if the directory doesn't exist. | ||
| 5 | |||
| 1 | 2014-03-05 Lars Ingebrigtsen <larsi@gnus.org> | 6 | 2014-03-05 Lars Ingebrigtsen <larsi@gnus.org> |
| 2 | 7 | ||
| 3 | * gnus-group.el (gnus-group-make-group): Clarify prompt. | 8 | * gnus-group.el (gnus-group-make-group): Clarify prompt. |
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 432aabbc4ad..67525ee0c1b 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el | |||
| @@ -4121,8 +4121,8 @@ CLEAN is obsolete and ignored." | |||
| 4121 | (defun gnus-agent-group-covered-p (group) | 4121 | (defun gnus-agent-group-covered-p (group) |
| 4122 | (gnus-agent-method-p (gnus-group-method group))) | 4122 | (gnus-agent-method-p (gnus-group-method group))) |
| 4123 | 4123 | ||
| 4124 | (defun gnus-agent-update-files-total-fetched-for | 4124 | (defun gnus-agent-update-files-total-fetched-for (group delta |
| 4125 | (group delta &optional method path) | 4125 | &optional method path) |
| 4126 | "Update, or set, the total disk space used by the articles that the | 4126 | "Update, or set, the total disk space used by the articles that the |
| 4127 | agent has fetched." | 4127 | agent has fetched." |
| 4128 | (when gnus-agent-total-fetched-hashtb | 4128 | (when gnus-agent-total-fetched-hashtb |
| @@ -4135,27 +4135,29 @@ agent has fetched." | |||
| 4135 | (gnus-sethash path (make-list 3 0) | 4135 | (gnus-sethash path (make-list 3 0) |
| 4136 | gnus-agent-total-fetched-hashtb))) | 4136 | gnus-agent-total-fetched-hashtb))) |
| 4137 | (file-name-coding-system nnmail-pathname-coding-system)) | 4137 | (file-name-coding-system nnmail-pathname-coding-system)) |
| 4138 | (when (listp delta) | 4138 | (when (file-exists-p path) |
| 4139 | (if delta | 4139 | (when (listp delta) |
| 4140 | (let ((sum 0.0) | 4140 | (if delta |
| 4141 | (let ((sum 0.0) | ||
| 4142 | file) | ||
| 4143 | (while (setq file (pop delta)) | ||
| 4144 | (incf sum (float (or (nth 7 (file-attributes | ||
| 4145 | (nnheader-concat | ||
| 4146 | path | ||
| 4147 | (if (numberp file) | ||
| 4148 | (number-to-string file) | ||
| 4149 | file)))) 0)))) | ||
| 4150 | (setq delta sum)) | ||
| 4151 | (let ((sum (- (nth 2 entry))) | ||
| 4152 | (info (directory-files-and-attributes | ||
| 4153 | path nil "^-?[0-9]+$" t)) | ||
| 4141 | file) | 4154 | file) |
| 4142 | (while (setq file (pop delta)) | 4155 | (while (setq file (pop info)) |
| 4143 | (incf sum (float (or (nth 7 (file-attributes | 4156 | (incf sum (float (or (nth 8 file) 0)))) |
| 4144 | (nnheader-concat | 4157 | (setq delta sum)))) |
| 4145 | path | ||
| 4146 | (if (numberp file) | ||
| 4147 | (number-to-string file) | ||
| 4148 | file)))) 0)))) | ||
| 4149 | (setq delta sum)) | ||
| 4150 | (let ((sum (- (nth 2 entry))) | ||
| 4151 | (info (directory-files-and-attributes path nil "^-?[0-9]+$" t)) | ||
| 4152 | file) | ||
| 4153 | (while (setq file (pop info)) | ||
| 4154 | (incf sum (float (or (nth 8 file) 0)))) | ||
| 4155 | (setq delta sum)))) | ||
| 4156 | 4158 | ||
| 4157 | (setq gnus-agent-need-update-total-fetched-for t) | 4159 | (setq gnus-agent-need-update-total-fetched-for t) |
| 4158 | (incf (nth 2 entry) delta))))) | 4160 | (incf (nth 2 entry) delta)))))) |
| 4159 | 4161 | ||
| 4160 | (defun gnus-agent-update-view-total-fetched-for | 4162 | (defun gnus-agent-update-view-total-fetched-for |
| 4161 | (group agent-over &optional method path) | 4163 | (group agent-over &optional method path) |