emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to generate a Unique id to include a headline
@ 2009-02-25  0:02 Charles Cave
  2009-02-25  3:16 ` Nick Dokos
  0 siblings, 1 reply; 2+ messages in thread
From: Charles Cave @ 2009-02-25  0:02 UTC (permalink / raw)
  To: emacs-orgmode

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.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to generate a Unique id to include a headline
  2009-02-25  0:02 How to generate a Unique id to include a headline Charles Cave
@ 2009-02-25  3:16 ` Nick Dokos
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Dokos @ 2009-02-25  3:16 UTC (permalink / raw)
  To: charles_cave; +Cc: emacs-orgmode

Charles Cave <charles_cave@optusnet.com.au> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-25  3:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-25  0:02 How to generate a Unique id to include a headline Charles Cave
2009-02-25  3:16 ` Nick Dokos

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).