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


Reply via email to