emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: charles_cave@optusnet.com.au
Cc: emacs-orgmode@gnu.org
Subject: Re: How to generate a Unique id to include a headline
Date: Tue, 24 Feb 2009 22:16:32 -0500	[thread overview]
Message-ID: <28834.1235531792@gamaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Charles Cave <charles_cave@optusnet.com.au> of "Wed, 25 Feb 2009 11:02:37 +1100." <200902250002.n1P02bJf001852@mail11.syd.optusnet.com.au>

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

      reply	other threads:[~2009-02-25  3:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25  0:02 How to generate a Unique id to include a headline Charles Cave
2009-02-25  3:16 ` Nick Dokos [this message]

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=28834.1235531792@gamaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=charles_cave@optusnet.com.au \
    --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).