From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rodney Lorrimar Subject: [PATCH] org-contacts: Use progress-reporter for cache update message Date: Sat, 04 May 2013 22:09:10 +0800 Message-ID: <878v3uzvjt.fsf@rodney.id.au> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYd9Q-0006LV-A1 for emacs-orgmode@gnu.org; Sat, 04 May 2013 10:09:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYd9N-0004mh-74 for emacs-orgmode@gnu.org; Sat, 04 May 2013 10:09:24 -0400 Received: from rodney.id.au ([178.79.159.183]:40982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYd9N-0004lw-0p for emacs-orgmode@gnu.org; Sat, 04 May 2013 10:09:21 -0400 Received: from 14-203-168-144.static.tpgi.com.au ([14.203.168.144] helo=glamdring) by rodney.id.au with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1UYd96-0005cd-M0 for emacs-orgmode@gnu.org; Sat, 04 May 2013 14:09:05 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * 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. --- contrib/lisp/org-contacts.el | 36 ++++++++++++++++++++---------------- 1 file 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) -- 1.7.10.4