From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: [PATCH 3/3] Remove empty property drawers in cloned subtrees. Date: Wed, 19 May 2010 20:53:27 +0200 Message-ID: <1274295207-4961-3-git-send-email-dmaus@ictsoc.de> References: <1274295207-4961-1-git-send-email-dmaus@ictsoc.de> Return-path: Received: from [140.186.70.92] (port=47487 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEoPS-0006TB-T2 for emacs-orgmode@gnu.org; Wed, 19 May 2010 14:54:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEoPR-0006Ll-12 for emacs-orgmode@gnu.org; Wed, 19 May 2010 14:54:26 -0400 Received: from mysql1.xlhost.de ([213.202.242.106]:41937) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEoPQ-0006LU-E6 for emacs-orgmode@gnu.org; Wed, 19 May 2010 14:54:24 -0400 In-Reply-To: <1274295207-4961-1-git-send-email-dmaus@ictsoc.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --- 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 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