emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marcelo de Moraes Serpa <celoserpa@gmail.com>
To: "Filippo A. Salustri" <salustri@ryerson.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: a small contribution
Date: Tue, 8 Mar 2011 12:03:25 -0600	[thread overview]
Message-ID: <AANLkTinUc0PSx4KRwS-Db0O2B7V21Sq=KbuqUAK_Q78v@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimYty=EC_J_7HV8gB+ERJYyCbp7Y+D6JvLVKtE5@mail.gmail.com>

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 <salustri@ryerson.ca> wrote:
> Hi all,
> I use geektool on my Mac to put useful things on my desktop.  (Rainmeter 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 cycles.
> So I wrote a small perl program that digests every file in my org directory
> looking for todos.  It runs blindingly fast compared to emacs, and it does
> 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.  But it does work for me.
> Cheers.
> Fil
> #!/usr/bin/perl
> $orgdir = '/Users/fil/Dropbox/org';
> $re = 'ACTIVE|REVIEW';
> @files = ();
> $line = '';
> $category = '';
> # get files
> opendir D, $orgdir;
> @files = grep { /\.org$/ } readdir(D);
> closedir D;
> for my $file (@files) {
>   $category = $file;
>   $category =~ s/\.org$//;
>   open F, "$orgdir/$file";
>   while ($line = <F>) {
>     if ( $line =~ m/:CATEGORY: *(.+)$/ ) { $category = $1; }
>     if ( $line =~ m/^\*+ +($re) +(.+)$/ ) {
>       printf "%-13s: %s\n", $category, $2;
>     }
>   }
>   close 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/
>

  reply	other threads:[~2011-03-08 18:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07 19:17 a small contribution Filippo A. Salustri
2011-03-08 18:03 ` Marcelo de Moraes Serpa [this message]
2011-03-17  9:59 ` Bastien

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='AANLkTinUc0PSx4KRwS-Db0O2B7V21Sq=KbuqUAK_Q78v@mail.gmail.com' \
    --to=celoserpa@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=salustri@ryerson.ca \
    /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).