emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Osamu OKANO <okano.osamu@gmail.com>
To: Matt Lundin <mdl@imapmail.org>
Cc: org-mode <emacs-orgmode@gnu.org>
Subject: Re: Can I get match count?
Date: Wed, 27 Apr 2011 23:40:17 +0900	[thread overview]
Message-ID: <BANLkTikDAo-qLkUs++RJ7Vias6oBne+nEQ@mail.gmail.com> (raw)
In-Reply-To: <87fwp4qufn.fsf@fastmail.fm>

Hi!
Thank you for your advice.
I made a growl script and set to crontab.
It works correctly.

#+BEGIN_SRC sh
m=`emacsclient -e '(org-agenda-match-count
"TODO=\"TODO\"STYLE=\"habit\"+SCHEDULED<=\"<now>\"")'`
if [ "0" -ne $m ]
then
    growlnotify \
        /t:"org habit" \
        /s:true \
        /silent:true \
        "$m habits left."
fi
#+END_SRC

#+BEGIN_SRC emacs-lisp
(defun org-agenda-match-count (str)
 (length
  (org-map-entries t str 'agenda)))
#+END_SRC

Regards.

      reply	other threads:[~2011-04-27 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-25 14:43 Can I get match count? Osamu OKANO
2011-04-27  2:50 ` Matt Lundin
2011-04-27 14:40   ` Osamu OKANO [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=BANLkTikDAo-qLkUs++RJ7Vias6oBne+nEQ@mail.gmail.com \
    --to=okano.osamu@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mdl@imapmail.org \
    /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).