From mboxrd@z Thu Jan 1 00:00:00 1970 From: Osamu OKANO Subject: Re: Can I get match count? Date: Wed, 27 Apr 2011 23:40:17 +0900 Message-ID: References: <87fwp4qufn.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF5uh-0004z8-1s for emacs-orgmode@gnu.org; Wed, 27 Apr 2011 10:40:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QF5uc-00009p-Vd for emacs-orgmode@gnu.org; Wed, 27 Apr 2011 10:40:22 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:42917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF5uc-00009e-Rh for emacs-orgmode@gnu.org; Wed, 27 Apr 2011 10:40:18 -0400 Received: by iyh42 with SMTP id 42so2021229iyh.0 for ; Wed, 27 Apr 2011 07:40:17 -0700 (PDT) In-Reply-To: <87fwp4qufn.fsf@fastmail.fm> 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: Matt Lundin Cc: org-mode 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<=\"\"")'` 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.