From: Uwe Ziegenhagen <ziegenhagen@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: move org line to next superior level
Date: Thu, 29 May 2014 18:15:16 +0000 (UTC) [thread overview]
Message-ID: <loom.20140529T195340-931@post.gmane.org> (raw)
In-Reply-To: 874n08zmjf.fsf@gmail.com
Thorsten Jolitz <tjolitz <at> 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
next prev parent reply other threads:[~2014-05-29 18:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 3:57 move org line to next superior level Uwe Ziegenhagen
2014-05-29 14:28 ` Thorsten Jolitz
2014-05-29 15:12 ` Eric Abrahamsen
2014-05-29 17:16 ` Uwe Ziegenhagen
2014-05-29 18:03 ` Thorsten Jolitz
2014-05-29 18:15 ` Uwe Ziegenhagen [this message]
2014-05-30 9:16 ` Thorsten Jolitz
2014-05-29 17:29 ` Bastien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20140529T195340-931@post.gmane.org \
--to=ziegenhagen@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.