فهرست منبع

Include domain name into newly created IDs.

Carsten Dominik 17 سال پیش
والد
کامیت
6ba68246c0
4فایلهای تغییر یافته به همراه30 افزوده شده و 3 حذف شده
  1. 6 0
      contrib/ChangeLog
  2. 14 3
      contrib/lisp/org-id.el
  3. 4 0
      lisp/ChangeLog
  4. 6 0
      lisp/org-exp.el

+ 6 - 0
contrib/ChangeLog

@@ -1,3 +1,9 @@
+2008-05-15  Carsten Dominik  <dominik@science.uva.nl>
+
+	* 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  <jason@acm.org>
 
 	* lisp/orgtbl-sqlinsert.el (orgtbl-to-sqlinsert): Use the

+ 14 - 3
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."

+ 4 - 0
lisp/ChangeLog

@@ -1,3 +1,7 @@
+2008-05-15  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org-exp.el (org-icalendar-force-UID): New option.
+
 2008-05-14  Carsten Dominik  <dominik@science.uva.nl>
 
 	* org-exp.el (org-print-icalendar-entries): Make sure DTEND is

+ 6 - 0
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