From 6ba68246c0a2bb99c6bb340e62be4a312178976c Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 15 May 2008 09:39:34 +0200 Subject: [PATCH] Include domain name into newly created IDs. --- contrib/ChangeLog | 6 ++++++ contrib/lisp/org-id.el | 17 ++++++++++++++--- lisp/ChangeLog | 4 ++++ lisp/org-exp.el | 6 ++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 85a7a27b9..2be7e9367 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,9 @@ +2008-05-15 Carsten Dominik + + * lisp/org-id.el (org-id-include-domain): New option. + (org-id-new): Add the domain name to an ID if + `org-id-include-domain' is set. + 2008-05-04 Jason Riedy * lisp/orgtbl-sqlinsert.el (orgtbl-to-sqlinsert): Use the diff --git a/contrib/lisp/org-id.el b/contrib/lisp/org-id.el index 0ee4f5ed4..22b6c1476 100644 --- a/contrib/lisp/org-id.el +++ b/contrib/lisp/org-id.el @@ -86,6 +86,13 @@ to have no space characters in them." (const :tag "No prefix") (string :tag "Prefix"))) +(defcustom org-id-include-domain t + "Non-nil means, add the domain name to new IDs. +This ensures global uniqueness of ID's, and is also suggested by +RFC 2445 in combination with RFC 822." + :group 'org-id + :type 'boolean) + (defcustom org-id-locations-file "~/.org-id-locations" "The file for remembering the last ID number generated." :group 'org-id @@ -209,10 +216,14 @@ So a typical ID could look like \"Org:4nd91V40HI\"." (let* ((prefix (if (eq prefix 'none) nil (or prefix org-id-prefix))) - (etime (org-id-time-to-b62))) + (etime (org-id-time-to-b62)) + (postfix (if org-id-include-domain + (progn + (require 'message) + (concat "@" (message-make-fqdn)))))) (if prefix - (concat prefix ":" etime) - etime))) + (concat prefix ":" etime postfix) + (concat etime postfix)))) (defun org-id-int-to-b62-one-digit (i) "Turn an integer between 0 and 61 into a single character 0..9, A..Z, a..z." diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07e336c77..f93ae2ec7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2008-05-15 Carsten Dominik + + * org-exp.el (org-icalendar-force-UID): New option. + 2008-05-14 Carsten Dominik * org-exp.el (org-print-icalendar-entries): Make sure DTEND is diff --git a/lisp/org-exp.el b/lisp/org-exp.el index f76f87a90..b2764d933 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -632,6 +632,12 @@ The text will be inserted into the DESCRIPTION field." :group 'org-export-icalendar :type 'string) +(defcustom org-icalendar-force-UID nil + "Non-nil means, each exported entry must have a UID. +If not present, that UID will be created." + :group 'org-export-icalendar + :type 'boolean) + ;;;; Exporting ;;; Variables, constants, and parameter plists -- 2.11.4.GIT