emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH 3/3] Remove empty property drawers in cloned subtrees.


From: David Maus
Subject: [Orgmode] [PATCH 3/3] Remove empty property drawers in cloned subtrees.
Date: Wed, 19 May 2010 20:53:27 +0200

---
 lisp/ChangeLog |    2 ++
 lisp/org.el    |    7 +++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ba65761..7c743a1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -7,6 +7,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  <address@hidden>
 
diff --git a/lisp/org.el b/lisp/org.el
index 88d636d..db0f5e2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7215,6 +7215,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)
@@ -7223,6 +7227,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)
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]