From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo de Moraes Serpa Subject: Re: a small contribution Date: Tue, 8 Mar 2011 12:03:25 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=55154 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Px1Fo-0008Gh-61 for emacs-orgmode@gnu.org; Tue, 08 Mar 2011 13:03:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Px1Fn-0008Fe-4K for emacs-orgmode@gnu.org; Tue, 08 Mar 2011 13:03:28 -0500 Received: from mail-iw0-f169.google.com ([209.85.214.169]:45918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Px1Fn-0008FQ-1E for emacs-orgmode@gnu.org; Tue, 08 Mar 2011 13:03:27 -0500 Received: by iwl42 with SMTP id 42so7116908iwl.0 for ; Tue, 08 Mar 2011 10:03:26 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Filippo A. Salustri" Cc: emacs-orgmode@gnu.org Nice Filippo. I think this kind of integration stuff is really interesting. I was thinking about something similar as well. Thanks for sharing. On Mon, Mar 7, 2011 at 1:17 PM, Filippo A. Salustri w= rote: > Hi all, > I use geektool on my Mac to put useful things on my desktop. =A0(Rainmete= r is > the equivalent program for windoze.) > Anyways, I would like have some todo items show up in geektool, but emacs > eats cpu, aquamacs doesn't do --batch stuff well, and I hate wasting cycl= es. > So I wrote a small perl program that digests every file in my org directo= ry > looking for todos. =A0It runs blindingly fast compared to emacs, and it d= oes > what I need it to. > I've included the script at the end of this msg, should anyone else find = it > interesting. > One should consider changing the values of $orgdir and $re. > And (maybe) the location of perl. > It parses :CATEGORY: properties and prints that out (or the file name if > there's no category) for each task with a keyword matching one in $re. > It's not perfect, I know. =A0But it does work for me. > Cheers. > Fil > #!/usr/bin/perl > $orgdir =3D '/Users/fil/Dropbox/org'; > $re =3D 'ACTIVE|REVIEW'; > @files =3D (); > $line =3D ''; > $category =3D ''; > # get files > opendir D, $orgdir; > @files =3D grep { /\.org$/ } readdir(D); > closedir D; > for my $file (@files) { > =A0=A0$category =3D $file; > =A0=A0$category =3D~ s/\.org$//; > =A0=A0open F, "$orgdir/$file"; > =A0=A0while ($line =3D ) { > =A0=A0 =A0if ( $line =3D~ m/:CATEGORY: *(.+)$/ ) { $category =3D $1; } > =A0=A0 =A0if ( $line =3D~ m/^\*+ +($re) +(.+)$/ ) { > =A0=A0 =A0 =A0printf "%-13s: %s\n", $category, $2; > =A0=A0 =A0} > =A0=A0} > =A0=A0close F; > } > > -- > Filippo A. Salustri, Ph.D., P.Eng. > Mechanical and Industrial Engineering > Ryerson University > 350 Victoria St, Toronto, ON > M5B 2K3, Canada > Tel: 416/979-5000 ext 7749 > Fax: 416/979-5265 > Email: salustri@ryerson.ca > http://deseng.ryerson.ca/~fil/ >