aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatsumi Yamaoka2010-08-13 11:03:19 +0000
committerKatsumi Yamaoka2010-08-13 11:03:19 +0000
commit186a9cbb9d4e7e9fd74249501ce6838442c7c11a (patch)
tree0b0d877406cb75a3a3848d815377e5dfd8389429
parent79993b193e9766c7c8731549a68b6a27eac89f1d (diff)
downloademacs-186a9cbb9d4e7e9fd74249501ce6838442c7c11a.tar.gz
emacs-186a9cbb9d4e7e9fd74249501ce6838442c7c11a.zip
Optimizations for gnus-sync.el.
From Ted Zlatanov <tzz@lifelogs.com>. * gnus-sync.el: Add docs about gnus-sync-backend possibilities. (gnus-sync-save): Remove unnecessary message. (gnus-sync-read): Optimize and show what groups were skipped.
-rw-r--r--lisp/gnus/ChangeLog9
-rw-r--r--lisp/gnus/gnus-sync.el36
2 files changed, 34 insertions, 11 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index b61eb330792..40e4fe8ab66 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,5 +1,14 @@
12010-08-12 Teodor Zlatanov <tzz@lifelogs.com> 12010-08-12 Teodor Zlatanov <tzz@lifelogs.com>
2 2
3 Optimizations for gnus-sync.el.
4
5 * gnus-sync.el: Add docs about gnus-sync-backend
6 possibilities.
7 (gnus-sync-save): Remove unnecessary message.
8 (gnus-sync-read): Optimize and show what groups were skipped.
9
102010-08-12 Teodor Zlatanov <tzz@lifelogs.com>
11
3 Minor bug fixes for gnus-sync.el. 12 Minor bug fixes for gnus-sync.el.
4 13
5 * gnus-sync.el (gnus-sync-unload-hook, gnus-sync-install-hooks): Don't 14 * gnus-sync.el (gnus-sync-unload-hook, gnus-sync-install-hooks): Don't
diff --git a/lisp/gnus/gnus-sync.el b/lisp/gnus/gnus-sync.el
index bd889576dc0..236a8742630 100644
--- a/lisp/gnus/gnus-sync.el
+++ b/lisp/gnus/gnus-sync.el
@@ -27,6 +27,11 @@
27 27
28;; Put this in your startup file (~/.gnus.el for instance) 28;; Put this in your startup file (~/.gnus.el for instance)
29 29
30;; possibilities for gnus-sync-backend:
31;; Tramp over SSH: /ssh:user@host:/path/to/filename
32;; Tramp over IMAP: /imaps:user@yourhosthere.com:/INBOX.test/filename
33;; ...or any other file Tramp and Emacs can handle...
34
30;; (setq gnus-sync-backend `("/remote:/path.gpg") ; will use Tramp+EPA if loaded 35;; (setq gnus-sync-backend `("/remote:/path.gpg") ; will use Tramp+EPA if loaded
31;; gnus-sync-global-vars `(gnus-newsrc-last-checked-date) 36;; gnus-sync-global-vars `(gnus-newsrc-last-checked-date)
32;; gnus-sync-newsrc-groups `("nntp" "nnrss") 37;; gnus-sync-newsrc-groups `("nntp" "nnrss")
@@ -85,7 +90,6 @@ synchronized, I believe). Also see `gnus-variable-list'."
85(defun gnus-sync-save () 90(defun gnus-sync-save ()
86"Save the Gnus sync data to the backend." 91"Save the Gnus sync data to the backend."
87 (interactive) 92 (interactive)
88 (gnus-message 6 "Saving the Gnus sync data")
89 (cond 93 (cond
90 ((stringp gnus-sync-backend) 94 ((stringp gnus-sync-backend)
91 (gnus-message 7 "gnus-sync: saving to backend %s" gnus-sync-backend) 95 (gnus-message 7 "gnus-sync: saving to backend %s" gnus-sync-backend)
@@ -162,21 +166,31 @@ synchronized, I believe). Also see `gnus-variable-list'."
162 (load gnus-sync-backend nil t) 166 (load gnus-sync-backend nil t)
163 (error 167 (error
164 (error "Error in %s: %s" gnus-sync-backend (cadr var))))) 168 (error "Error in %s: %s" gnus-sync-backend (cadr var)))))
165 (let ((valid-nodes 169 (let ((valid-count 0)
166 (loop for node in gnus-sync-newsrc-loader 170 invalid-groups)
167 if (gnus-gethash (car node) gnus-newsrc-hashtb) 171 (dolist (node gnus-sync-newsrc-loader)
168 collect node))) 172 (if (gnus-gethash (car node) gnus-newsrc-hashtb)
169 (dolist (node valid-nodes) 173 (progn
170 (loop for store in (cdr node) 174 (incf valid-count)
171 do (setf (nth (car store) 175 (loop for store in (cdr node)
172 (assoc (car node) gnus-newsrc-alist)) 176 do (setf (nth (car store)
177 (assoc (car node) gnus-newsrc-alist))
173 (cdr store)))) 178 (cdr store))))
179 (push (car node) invalid-groups)))
174 (gnus-message 180 (gnus-message
175 7 181 7
176 "gnus-sync: loaded %d groups (out of %d) from %s" 182 "gnus-sync: loaded %d groups (out of %d) from %s"
177 (length valid-nodes) 183 valid-count (length gnus-sync-newsrc-loader)
178 (length gnus-sync-newsrc-loader)
179 gnus-sync-backend) 184 gnus-sync-backend)
185 (when invalid-groups
186 (gnus-message
187 7
188 "gnus-sync: skipped %d groups (out of %d) from %s"
189 (length invalid-groups)
190 (length gnus-sync-newsrc-loader)
191 gnus-sync-backend)
192 (gnus-message 9 "gnus-sync: skipped groups: %s"
193 (mapconcat 'identity invalid-groups ", ")))
180 (setq gnus-sync-newsrc-loader nil))) 194 (setq gnus-sync-newsrc-loader nil)))
181 (nil)) 195 (nil))
182 ;; make the hashtable again because the newsrc-alist may have been modified 196 ;; make the hashtable again because the newsrc-alist may have been modified