diff --git a/lisp/org.el b/lisp/org.el index 6e12d02b3..9bc67a8e1 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -23427,11 +23427,10 @@ Universal Time." TIMESTAMP is a timestamp object. END, when non-nil, means extract the end of the range. Otherwise, extract its start. -Return a new timestamp object sharing the same parent as -TIMESTAMP." +Return a new timestamp object." (let ((type (org-element-property :type timestamp))) (if (memq type '(active inactive diary)) timestamp - (let ((split-ts (list 'timestamp (copy-sequence (nth 1 timestamp))))) + (let ((split-ts (org-element-copy timestamp))) ;; Set new type. (org-element-put-property split-ts :type (if (eq type 'active-range) 'active 'inactive)) @@ -23445,9 +23444,9 @@ TIMESTAMP." (dolist (p-cell p-alist) (org-element-put-property split-ts - (funcall (if end 'car 'cdr) p-cell) + (funcall (if end #'car #'cdr) p-cell) (org-element-property - (funcall (if end 'cdr 'car) p-cell) split-ts))) + (funcall (if end #'cdr #'car) p-cell) split-ts))) ;; Eventually refresh `:raw-value'. (org-element-put-property split-ts :raw-value nil) (org-element-put-property diff --git a/lisp/ox.el b/lisp/ox.el index 1aacbd039..cdfc8ed78 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -2878,12 +2878,7 @@ Return code as a string." (eq (org-element-type (car date)) 'timestamp)) (format "(eval (if (org-string-nw-p \"$1\") %s %S))" (format "(org-timestamp-format '%S \"$1\")" - ;; Remove parent to avoid - ;; read error. - `(timestamp - ,(org-combine-plists - (nth 1 (car date)) - '(:parent nil)))) + (org-element-copy (car date))) value) value))) ;; EMAIL is not a parsed keyword: store it as-is. diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 5afeba0a8..ce1d51914 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -3214,14 +3214,7 @@ Text. (org-test-with-temp-text "<%%(org-float t 4 2)>" (let* ((ts-orig (org-element-context)) (ts-copy (org-timestamp-split-range ts-orig))) - (eq ts-orig ts-copy)))) - ;; Check that parent is the same when a range was split. - (should - (org-test-with-temp-text "[2012-03-29 Thu]--[2012-03-30 Fri]" - (let* ((ts-orig (org-element-context)) - (ts-copy (org-timestamp-split-range ts-orig))) - (eq (org-element-property :parent ts-orig) - (org-element-property :parent ts-copy)))))) + (eq ts-orig ts-copy))))) (ert-deftest test-org/timestamp-translate () "Test `org-timestamp-translate' specifications."