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.
This commit is contained in:
Rodney Lorrimar 2013-05-04 22:09:10 +08:00 committed by Carsten Dominik
parent 9bd8101c56
commit beb76bf435

View file

@ -211,22 +211,26 @@ A regexp matching strings of whitespace, `,' and `;'.")
(cdr (org-make-tags-matcher org-contacts-matcher))) (cdr (org-make-tags-matcher org-contacts-matcher)))
markers result) markers result)
(when (org-contacts-db-need-update-p) (when (org-contacts-db-need-update-p)
(message "Update Org Contacts Database") (let ((progress-reporter
(dolist (file (org-contacts-files)) (make-progress-reporter "Updating Org Contacts Database..." 0 (length org-contacts-files)))
(org-check-agenda-file file) (i 0))
(with-current-buffer (org-get-agenda-file-buffer file) (dolist (file (org-contacts-files))
(unless (eq major-mode 'org-mode) (org-check-agenda-file file)
(error "File %s is no in `org-mode'" file)) (with-current-buffer (org-get-agenda-file-buffer file)
(org-scan-tags (unless (eq major-mode 'org-mode)
'(add-to-list 'markers (set-marker (make-marker) (point))) (error "File %s is no in `org-mode'" file))
contacts-matcher (org-scan-tags
todo-only))) '(add-to-list 'markers (set-marker (make-marker) (point)))
(dolist (marker markers result) contacts-matcher
(org-with-point-at marker todo-only))
(add-to-list 'result (progress-reporter-update progress-reporter (setq i (1+ i))))
(list (org-get-heading t) marker (org-entry-properties marker 'all))))) (dolist (marker markers result)
(setf org-contacts-db result (org-with-point-at marker
org-contacts-last-update (current-time))) (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)) org-contacts-db))
(defun org-contacts-filter (&optional name-match tags-match) (defun org-contacts-filter (&optional name-match tags-match)