org-id.el: New option org-id-uuid-program to set uuidgen program.

On some systems, uuidgen is named uuid.
Let the user define the uuidgen program name.
This commit is contained in:
Bastien Guerry 2009-07-24 02:29:56 +02:00
parent 5a7f43293d
commit bd4a9fe510
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2009-07-24 Bastien Guerry <bzg@altern.org>
* org-id.el (org-id-uuid-program): New option to set the name of
the uuidgen program.
(org-id-method): Use `org-id-uuid-program'.
(org-id-new): Use `org-id-uuid-program'.
2009-07-23 Bastien Guerry <bzg@altern.org>
* org-exp.el (org-export-number-lines): Allow whitespace in code

View File

@ -79,11 +79,16 @@
:tag "Org ID"
:group 'org)
(defcustom org-id-uuid-program "uuidgen"
"The uuidgen program."
:group 'org-id
:type 'string)
(defcustom org-id-method
(condition-case nil
(if (string-match "\\`[-0-9a-fA-F]\\{36\\}\\'"
(org-trim (shell-command-to-string "uuidgen")))
(org-trim (shell-command-to-string
org-id-uuid-program)))
'uuidgen
'org)
(error 'org))
@ -301,7 +306,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"."
(if (equal prefix ":") (setq prefix ""))
(cond
((eq org-id-method 'uuidgen)
(setq unique (org-trim (shell-command-to-string "uuidgen"))))
(setq unique (org-trim (shell-command-to-string org-id-uuid-program))))
((eq org-id-method 'org)
(let* ((etime (org-id-reverse-string (org-id-time-to-b36)))
(postfix (if org-id-include-domain