From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Three questions about Org-mode API Date: Mon, 12 May 2008 13:03:10 +0200 Message-ID: <1E0F063B-FC61-436F-B5F9-EBAAD47BAD64@science.uva.nl> References: Mime-Version: 1.0 (Apple Message framework v919.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JvVoI-0005cR-T0 for emacs-orgmode@gnu.org; Mon, 12 May 2008 07:03:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JvVoI-0005c2-3i for emacs-orgmode@gnu.org; Mon, 12 May 2008 07:03:14 -0400 Received: from [199.232.76.173] (port=41437 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvVoH-0005by-Pq for emacs-orgmode@gnu.org; Mon, 12 May 2008 07:03:13 -0400 Received: from korteweg.uva.nl ([146.50.98.70]:21441) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JvVoH-0007Sc-5g for emacs-orgmode@gnu.org; Mon, 12 May 2008 07:03:13 -0400 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: Dmitri Minaev Cc: org-mode On May 11, 2008, at 9:19 PM, Dmitri Minaev wrote: > Hello, > > I use org-mode as a front-end to view and edit the data stored in a > list. It's easy and fast to render the list as an Org-mode tree, but I > have some problems with the performance when I convert the data back > to the list. > > 1. If I want to retrieve all properties of an entry (a thousand or two > of entries, for that matter), what would be faster: using > org-entry-get for every property, org-entry-properties or using custom > regexps? 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) at each headline, which would get rid of the considerable overhead of getting the special properties. This still has some overhead, so custom regexps could speed this up a bit. 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. 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. > 2. Is there a way to obtain programmatically the contents of an entry, > the text in it (assuming the entry has no children nodes)? 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. > 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. - Carsten