summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodney Lorrimar <rodney@rodney.id.au>2013-05-04 22:09:10 +0800
committerCarsten Dominik <carsten.dominik@gmail.com>2013-05-04 18:47:55 +0200
commit40b24a82f4810c23f9e1f92f11ba1a9f12fbe9bb (patch)
treeb248565e6663bcf05114d7c4f84e1244b797fa8f
parent15a72f6256b0c78d18cdcf36b23e03696b1f2642 (diff)
downloadorg-mode-40b24a82f4810c23f9e1f92f11ba1a9f12fbe9bb.tar.gz
org-contacts: Use progress-reporter for cache update message
* contrib/lisp/org-contacts.el (org-contacts-db): Use `make-progress-reporter' instead of `message' for messages. Also change the sentence to present progressive tense.
-rw-r--r--contrib/lisp/org-contacts.el36
1 files changed, 20 insertions, 16 deletions
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 84ebc9d..c72e6c0 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -211,22 +211,26 @@ A regexp matching strings of whitespace, `,' and `;'.")
(cdr (org-make-tags-matcher org-contacts-matcher)))
markers result)
(when (org-contacts-db-need-update-p)
- (message "Update Org Contacts Database")
- (dolist (file (org-contacts-files))
- (org-check-agenda-file file)
- (with-current-buffer (org-get-agenda-file-buffer file)
- (unless (eq major-mode 'org-mode)
- (error "File %s is no in `org-mode'" file))
- (org-scan-tags
- '(add-to-list 'markers (set-marker (make-marker) (point)))
- contacts-matcher
- todo-only)))
- (dolist (marker markers result)
- (org-with-point-at marker
- (add-to-list 'result
- (list (org-get-heading t) marker (org-entry-properties marker 'all)))))
- (setf org-contacts-db result
- org-contacts-last-update (current-time)))
+ (let ((progress-reporter
+ (make-progress-reporter "Updating Org Contacts Database..." 0 (length org-contacts-files)))
+ (i 0))
+ (dolist (file (org-contacts-files))
+ (org-check-agenda-file file)
+ (with-current-buffer (org-get-agenda-file-buffer file)
+ (unless (eq major-mode 'org-mode)
+ (error "File %s is no in `org-mode'" file))
+ (org-scan-tags
+ '(add-to-list 'markers (set-marker (make-marker) (point)))
+ contacts-matcher
+ todo-only))
+ (progress-reporter-update progress-reporter (setq i (1+ i))))
+ (dolist (marker markers result)
+ (org-with-point-at marker
+ (add-to-list 'result
+ (list (org-get-heading t) marker (org-entry-properties marker 'all)))))
+ (setf org-contacts-db result
+ org-contacts-last-update (current-time))
+ (progress-reporter-done progress-reporter)))
org-contacts-db))
(defun org-contacts-filter (&optional name-match tags-match)