From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uwe Ziegenhagen Subject: Re: move org line to next superior level Date: Thu, 29 May 2014 18:15:16 +0000 (UTC) Message-ID: References: <874n08zmjf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wq4rb-0006MV-F6 for emacs-orgmode@gnu.org; Thu, 29 May 2014 14:15:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wq4rT-0001c6-SK for emacs-orgmode@gnu.org; Thu, 29 May 2014 14:15:39 -0400 Received: from plane.gmane.org ([80.91.229.3]:59641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wq4rT-0001bz-Kf for emacs-orgmode@gnu.org; Thu, 29 May 2014 14:15:31 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Wq4rR-0008NA-SE for emacs-orgmode@gnu.org; Thu, 29 May 2014 20:15:29 +0200 Received: from cable-78-34-39-130.netcologne.de ([78.34.39.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 May 2014 20:15:29 +0200 Received: from ziegenhagen by cable-78-34-39-130.netcologne.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 May 2014 20:15:29 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Thorsten Jolitz gmail.com> writes: > #+begin_src emacs-lisp > (defun tj/move-entry-to-next-day () > "Move entry at point to next parent and tag it." > (unless (org-on-heading-p) > (outline-previous-heading)) > (org-mark-subtree) > (kill-region (region-beginning) (region-end)) > (org-up-heading-safe) > (org-forward-heading-same-level 1) > (forward-line) > (yank) > (outline-previous-heading) > (org-mark-subtree) > (org-change-tag-in-region > (region-beginning) (region-end) "postponed" nil)) > #+end_src > > This works with you example Org snippet, but is not tested otherwise. > Hi Thorsten, your code works fine, I'd like to change it a little in that way that the original line should remain but should get the status "POSTPONED" I tried by inserting a new (yank) line, this didn't work as it sometimes moved the entry two headlines away. I am also not sure if org-todo is the correct command: (defun tj/move-entry-to-next-day () "Move entry at point to next parent and tag it." (unless (org-on-heading-p) (outline-previous-heading)) (org-mark-subtree) (kill-region (region-beginning) (region-end)) (yank) ;; causes issues (org-todo "POSTPONED") ;; is this correct? (org-up-heading-safe) (org-forward-heading-same-level 2) (forward-line) (yank) (outline-previous-heading) (org-mark-subtree) (org-change-tag-in-region (region-beginning) (region-end) "postponed" nil)) Uwe