From 6f1bd65fb67b4d0e49b7f7ba3a87ad2df01fb2f9 Mon Sep 17 00:00:00 2001 From: David Maus Date: Wed, 19 May 2010 20:49:22 +0200 Subject: [PATCH] Remove empty property drawers in cloned subtrees. --- lisp/ChangeLog | 2 ++ lisp/org.el | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d4a7fec5c..f65c5ca4e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -15,6 +15,8 @@ (org-clone-delete-id): New customization variable. (org-clone-subtree-with-time-shift): Use customization variable `org-clone-delete-id'. + (org-clone-subtree-with-time-shift): Remove empty property + drawer in cloned subtrees. 2010-05-17 Carsten Dominik diff --git a/lisp/org.el b/lisp/org.el index 904280462..0615c842c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7216,6 +7216,10 @@ and still retain the repeater to cover future instances of the task." (if org-clone-delete-id (org-entry-delete nil "ID") (org-id-get-create t)) + (while (re-search-forward + org-property-drawer-re nil t) + (org-remove-empty-drawer-at + "PROPERTIES" (point))) (buffer-string)))) (with-temp-buffer (insert template) @@ -7224,6 +7228,9 @@ and still retain the repeater to cover future instances of the task." (and idprop (if org-clone-delete-id (org-entry-delete nil "ID") (org-id-get-create t))) + (while (re-search-forward org-property-drawer-re nil t) + (org-remove-empty-drawer-at "PROPERTIES" (point))) + (goto-char (point-min)) (while (re-search-forward org-ts-regexp-both nil t) (org-timestamp-change (* n shift-n) shift-what)) (unless (= n n-no-remove) -- 2.11.4.GIT