From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] org-contacts: Use progress-reporter for cache update message Date: Sat, 4 May 2013 18:49:06 +0200 Message-ID: <630099CE-6C58-48E5-82F0-705A3715A100@gmail.com> References: <878v3uzvjt.fsf@rodney.id.au> Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYfe4-0004il-QP for emacs-orgmode@gnu.org; Sat, 04 May 2013 12:49:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYfe3-0001kx-Fp for emacs-orgmode@gnu.org; Sat, 04 May 2013 12:49:12 -0400 Received: from mail-wg0-x229.google.com ([2a00:1450:400c:c00::229]:50161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYfe3-0001kk-9n for emacs-orgmode@gnu.org; Sat, 04 May 2013 12:49:11 -0400 Received: by mail-wg0-f41.google.com with SMTP id y10so1569914wgg.2 for ; Sat, 04 May 2013 09:49:09 -0700 (PDT) In-Reply-To: <878v3uzvjt.fsf@rodney.id.au> 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: Rodney Lorrimar Cc: emacs-orgmode@gnu.org Applied, thanks. - Carsten On 4.5.2013, at 16:09, Rodney Lorrimar wrote: > * 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(-) >=20 > 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)) >=20 > (defun org-contacts-filter (&optional name-match tags-match) > --=20 > 1.7.10.4 >=20