emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Rodney Lorrimar <rodney@rodney.id.au>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-contacts: Use progress-reporter for cache update message
Date: Sat, 4 May 2013 18:49:06 +0200	[thread overview]
Message-ID: <630099CE-6C58-48E5-82F0-705A3715A100@gmail.com> (raw)
In-Reply-To: <878v3uzvjt.fsf@rodney.id.au>

Applied, thanks.

- Carsten

On 4.5.2013, at 16:09, Rodney Lorrimar <rodney@rodney.id.au> 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(-)
> 
> 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
> 

      reply	other threads:[~2013-05-04 16:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-04 14:09 [PATCH] org-contacts: Use progress-reporter for cache update message Rodney Lorrimar
2013-05-04 16:49 ` Carsten Dominik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=630099CE-6C58-48E5-82F0-705A3715A100@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rodney@rodney.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).