From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: How to generate a Unique id to include a headline Date: Tue, 24 Feb 2009 22:16:32 -0500 Message-ID: <28834.1235531792@gamaville.dokosmarshall.org> References: <200902250002.n1P02bJf001852@mail11.syd.optusnet.com.au> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LcAHG-0000Sm-6C for emacs-orgmode@gnu.org; Tue, 24 Feb 2009 22:17:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LcAHF-0000S8-93 for emacs-orgmode@gnu.org; Tue, 24 Feb 2009 22:17:41 -0500 Received: from [199.232.76.173] (port=50298 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LcAHF-0000S3-4M for emacs-orgmode@gnu.org; Tue, 24 Feb 2009 22:17:41 -0500 Received: from qmta01.westchester.pa.mail.comcast.net ([76.96.62.16]:35711) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LcAHE-0007K9-RX for emacs-orgmode@gnu.org; Tue, 24 Feb 2009 22:17:40 -0500 In-Reply-To: Message from Charles Cave of "Wed, 25 Feb 2009 11:02:37 +1100." <200902250002.n1P02bJf001852@mail11.syd.optusnet.com.au> 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: charles_cave@optusnet.com.au Cc: emacs-orgmode@gnu.org Charles Cave 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