emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] How to generate a Unique id to include a headline


From: Nick Dokos
Subject: Re: [Orgmode] How to generate a Unique id to include a headline
Date: Tue, 24 Feb 2009 22:16:32 -0500

Charles Cave <address@hidden> wrote:

> Is there a way to add a unique id into the headline assuming the existence
> of an external comman/script to generate the number?
> 
> I would like to include a cookie at the end of a headline that would allow
> me to synchronise my org-mode contents with another application
> (Listpro on Windows and Palm OS).    The cookie would be like a priority
> [Id 234]
> 
> I was planning to store the next available id in a text file and have a python
> script to generate the next available number, write to stdout, then increment
> the stored value.
> 

I have more questions than answers:

How does the cookie help with the synchronization? Is it just a matter of
generating a unique ID or are there more requirements?

If it *is* just a matter of generating a unique ID, maybe something like
the following would do:

(defun org-insert-heading-with-id ()
  (interactive)
  (org-insert-heading)
  (save-excursion
    (insert (format " [Id: %s]" (org-id-new)))))

The UUIDs that org-id-new generates are not pretty, but they are ready
made, so you don't need external programs - but are they adequate?
Is this anywhere near your requirements?

Regards,
Nick





reply via email to

[Prev in Thread] Current Thread [Next in Thread]