>From 9958d2783887dde8bcd6d50a28ecbafca31eb7c1 Mon Sep 17 00:00:00 2001 From: Niels Giesen Date: Fri, 11 Feb 2011 14:23:33 +0100 Subject: [PATCH 1/2] Pick up uid that may have been set by another application, e.g. org-mode. * lisp/calendar/icalendar.el (icalendar--create-uid): get a value for uid from 'uid text-property from first character of the entry, if existing, otherwise create the uid as before. --- lisp/calendar/icalendar.el | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index ca88548..b1d2bba 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -925,7 +925,10 @@ ENTRY-FULL is the full diary entry string. CONTENTS is the current iCalendar object, as a string. Increase `icalendar--uid-count'. Returns the UID string." (let ((uid icalendar-uid-format)) - + (if + ;;Allow other apps (such as org-mode) to create its own uid + (get-text-property 0 'uid entry-full) + (setq uid (get-text-property 0 'uid entry-full)) (setq uid (replace-regexp-in-string "%c" (format "%d" icalendar--uid-count) @@ -945,7 +948,7 @@ current iCalendar object, as a string. Increase (let ((dtstart (if (string-match "^DTSTART[^:]*:\\([0-9]*\\)" contents) (substring contents (match-beginning 1) (match-end 1)) "DTSTART"))) - (setq uid (replace-regexp-in-string "%s" dtstart uid t t))) + (setq uid (replace-regexp-in-string "%s" dtstart uid t t)))) ;; Return the UID string uid)) -- 1.7.1