Charles Cave <charles_c...@optusnet.com.au> wrote: > ... > print "[#%s]" % val > > > ... > > ESC-1 ESC-! nextnum RET Ctl-D > > The Ctrl D is needed to remove a carriage return (not sure why it is > there.
Try import sys sys.stdout.write("[%d]" % val) instead of print. It should work on Windows as well (but I have not tested it there). > > Can someone give me Lisp code equivalent of > the command sequene above? I know it is something to do > with (shell command .... ) > (shell-command "nextnum" t) It may be necessary to specify a complete path to the command. > > The end result now looks like > > *** Post to org-mode list about next sequential [#315] :COMPUTER: > > Once I have Lisp code to implement the command sequence I will have > a satisfactory solution to generating the unique id when I need it. > But I still don't understand why you need an external program: what is wrong with (insert (format "[%s]" (org-id-new)))? Are the IDs too ugly or is there some other problem? The trouble with unique IDs in files is that it's easy for them to get out of sync (leading to non-uniqueness), e.g. if there are two processes trying to get a unique id at the same time. Nick _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode