emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marcelo de Moraes Serpa <celoserpa@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [OT] The joy of elisp
Date: Mon, 5 Dec 2011 00:08:20 -0600	[thread overview]
Message-ID: <CACHMzOFsuK_EScWdT0gx-QgMmcvAyXmHS7HNJHjoZazQB4CvZQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1576 bytes --]

Hi list!

I decided to finally get my hands dirty and build a small function to
improve my org-based productivity system.

Let me explain:

I have a subdirectory under ~/org which has a bunch of files named after
different subjects. Originally it was supposed to model a wiki, but in
practice, I create a file there whenever I start studying a new (often
complex) subject and that I know I will come back often and edit / improve.
It's indeed like a wiki.

However, I don't keep those files in the agenda. It would slow it down a
lot. To keep the organization as organic as possible, I simply use tags to
bring them together semantically. So, I have other files with items that
are tagged, say, business, and I have a "wiki file" with a headline like
this:

* tags :business:

<contents>

I use the tags headline to tag those files.

Now, what I wanted was to get a list of files related to say, the business
tag. It's quite useful to find myself in the (good) chaos of tagged "wiki
files", I came up with a small elisp function that does just that!

(progn
(shell-command "cd ~/org;  ack \"\\* tags.*(business).*\" --all" "mybuf")
(set-buffer "mybuf")
(beginning-of-buffer)
(ignore-errors
  (while (search-forward-regexp "\\(.*?\\):")
    (replace-match "[[~/org/\\1]]" )
    ))
(org-mode)
)

Bear in mind this is my first elisp program ever. It's not even a function
yet, actually. But it works pretty well for what I want :)

Took me around 1 hour to bring it up.

The joy of breaking your head on something!

Cheers!

(Suggestions on how to improve it welcome!)

Marcelo.

[-- Attachment #2: Type: text/html, Size: 2153 bytes --]

             reply	other threads:[~2011-12-05  6:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05  6:08 Marcelo de Moraes Serpa [this message]
2011-12-05 17:34 ` [OT] The joy of elisp Marcelo de Moraes Serpa
2011-12-06 14:27   ` Eric Schulte

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=CACHMzOFsuK_EScWdT0gx-QgMmcvAyXmHS7HNJHjoZazQB4CvZQ@mail.gmail.com \
    --to=celoserpa@gmail.com \
    --cc=emacs-orgmode@gnu.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).