emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Dmitri Minaev" <minaev@gmail.com>
To: Carsten Dominik <dominik@science.uva.nl>
Cc: org-mode <emacs-orgmode@gnu.org>
Subject: Re: Three questions about Org-mode API
Date: Mon, 12 May 2008 23:36:46 +0500	[thread overview]
Message-ID: <b6c377310805121136j6ebe1184j282ede851578aefa@mail.gmail.com> (raw)
In-Reply-To: <1E0F063B-FC61-436F-B5F9-EBAAD47BAD64@science.uva.nl>

On Mon, May 12, 2008 at 4:03 PM, Carsten Dominik <dominik@science.uva.nl> wrote:
>  If you are talking only about the standard properties (i.e. not the TODO
> state or the tags, but just the properties in the drawer, the fastest
> inside-org way would be
>
>  (org-entry-get nil 'standard)

No, unfortunately, it won't do. I will need tags, TODO states and
priorities, among other things.

>  If speed is an issue, I would write an external program in perl.
>  I think I could write a perl parser that is at least a factor of 10 faster
>  than anything in emacs lisp.

Perhaps, this is true. But this is my first program in elisp and I
would like to take the chance to learn it :)

What if I ditch the org-mode tools and write a specialized parser in
elisp? My org file has a rather regular structure, with the uniform
properties located in the same order in all entries. Do you think it
would be faster?

>  One could also think of an external database, but that only would work will
> for a linear list of entries, and structure editing does ruin such things.

Hmm... How's that?

Well, what I'm writing is an ebooks catalog. I keep the "database" in
a list. To browse the catalog, I render it into an org-mode-compliant
text buffer and run org-mode. Here I can change tags, priorities, TODO
(toread) state, edit the description and, in some cases, the
information stored in standard properties: title, authors, genre, path
to the file. The database may be rendered in three modes: by title (1
level); by author/title (2 levels) and by genre/author/title (3
levels). When I've done with browsing and editing, I have to convert
the org-mode buffer back into the list. The number of books should be
large enough. As for now, I can deal with 1,000 of them with a
tolerable speed. But I hope to make the library work with up to 10,000
books. So, the list is not linear. And still... An external database?
How?

>  Check out Bastien's parser, I think it is in some branch in the git repo
>  (right Bastien???).  Although I don't know how fast this would be.

Thanks, I'll have a look at it.

> > 3. It would be nice to mark the edited entries as `dirty' to avoid the
> > conversion of non-changed entries. Any ideas?
>
>  This is hard, because you don't want to put any contraints on how the entry
> can be edited.  One could use text properties (during a single session) or
> Org properties, both triggered with after-change-functions, but that is a
> lot of editing overhead.

Could I use some hook that would add an extra property for every changed entry?

-- 
With best regards,
Dmitri Minaev

Russian history blog: http://minaev.blogspot.com

  reply	other threads:[~2008-05-12 18:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-11 19:19 Three questions about Org-mode API Dmitri Minaev
2008-05-12 11:03 ` Carsten Dominik
2008-05-12 18:36   ` Dmitri Minaev [this message]
2008-05-15  6:58     ` Carsten Dominik

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=b6c377310805121136j6ebe1184j282ede851578aefa@mail.gmail.com \
    --to=minaev@gmail.com \
    --cc=dominik@science.uva.nl \
    --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).