Re: [O] Customize org-todo-repeat-to-state to return to previous TODO state

2014-11-24 Thread Grant Schissler
Great, thanks for all the excellent advice and code!  I decided to approach
this locally with a capture template and put my repeating APPT tasks under
my Calendar headline.  I created this capture template that does the job:

(setq org-capture-templates
  '(("c" "Calendar" entry (file+headline "~/grantMain.org" "Calendar")
 "* APPT %?\n%i\n%a\n:PROPERTIES:\n:REPEAT_TO_STATE:
APPT\n:END:\n" :prepend t)))

Grant

On Fri, Nov 21, 2014 at 1:56 PM, Brady Trainor  wrote:

> Grant Schissler  writes:
>
> > Hi Org-mode Users,
> >
> > I am trying to change the behavior of marking a repeated task as DONE.  I
> > would like the task to return to the current TODO state rather than the
> first in
> > the TODO sequence or a fixed state.  For example,
> >
> > ** APPT Lunch with Mallorie
> > <2014-12-04 Thu 12:00 +1w>
> >
> > should return to APPT, not TODO or some other predefined state as in the
> > current behavior:
> >
> > TODO Lunch with Mallorie
> > - State "DONE"   from "APPT"   [2014-11-21 Fri 10:56]
> > <2014-12-11 Thu 12:00 +1w>
> >
> > I am sure that customizing the org-todo-repeat-to-state will do the
> trick, but
> > sadly, I have had the time to learn elisp well enough to perform this.
> >
> > Any help would be much appreciated.  Please let me know if you have
> > questions.
> >
> > Thanks for the support and to all those that make org-mode great!
> > Grant
>
> I haven't tried any of the following, and there may be better solutions,
> but...
>
> It looks like the variable you mention reads as (via C-h v
> org-todo-repeat-to-state RET and follow link to source),
>
> #+BEGIN_SRC emacs-lisp
> (defcustom org-todo-repeat-to-state nil
>   "The TODO state to which a repeater should return the repeating task.
> By default this is the first task in a TODO sequence, or the previous state
> in a TODO_TYP set.  But you can specify another task here.
> alternatively, set the :REPEAT_TO_STATE: property of the entry."
>   :group 'org-todo
>   :version "24.1"
>   :type '(choice (const :tag "Head of sequence" nil)
>  (string :tag "Specific state")))
>
> #+END_SRC
>
> It looks like this variable will not allow to recall the previous TODO
> state. But you could make a separate TODO_TYP set.
>
> Depending on whether you define your TODO states in an init file or
> per-file base, you could try an extra line in your org file "header",
>
> #+BEGIN_SRC org
> ,#+TYP_TODO: APPT | DONE
> #+END_SRC
>
> or an extra block in your org-todo-keywords variable
>
> #+BEGIN_SRC emacs-lisp
> (setq org-todo-keywords '((type "APPT" "|" "DONE")))
> #+END_SRC
>
> Another solution according to the above would be to use a property drawer,
>
> #+BEGIN_SRC org
> ,** APPT Lunch with Mallorie
> <2014-12-04 Thu 12:00 +1w>
> :PROPERTIES:
> :REPEAT_TO_STATE: APPT
> :END:
> #+END_SRC
>
> You can get this via C-c C-x p repeat_to_state RET APPT RET.
>
> Interestingly, there is a function in the same source file,
> org-auto-repeat-maybe, which suggests that it does exactly what you ask for.
>
> #+BEGIN_EXAMPLE
> org-auto-repeat-maybe is a compiled Lisp function in `org.el'.
>
> (org-auto-repeat-maybe DONE-WORD)
>
> Check if the current headline contains a repeated deadline/schedule.
> If yes, set TODO state back to what it was and change the base date
> of repeating deadline/scheduled time stamps to new date.
> This function is run automatically after each state change to a DONE state.
>
> [back]
> #+END_EXAMPLE
>
> I can see in the definition of the function it has an expression
> org-last-state, so maybe that suggests there is a way built-in (or intended
> to?), but I only took that quick look at the source.
>
> --
> Brady
>


Re: [O] Customizing org-todo-repeat-to-state to return to the current TODO state

2014-11-21 Thread Grant Schissler
Sorry, Nick.  I understand your point better now.  It may take a lot of
reorganizing, but I will let you know if I find something that works for
me. Thanks

On Fri, Nov 21, 2014 at 1:13 PM, Nick Dokos  wrote:

> Sebastien Vauban 
> writes:
>
> > Grant Schissler wrote:
> >> I am trying to change the behavior of marking a repeated task as DONE.
> I
> >> would like the task to return to the current TODO state rather than the
> >> first in the TODO sequence or a fixed state.  For example,
> >>
> >> ** APPT Lunch with Mallorie
> >> <2014-12-04 Thu 12:00 +1w>
> >>
> >> Should return to APPT, not TODO or some other predefined state as in the
> >> current behavior:
> >>
> >> TODO Lunch with Mallorie
> >> - State "DONE"   from "APPT"   [2014-11-21 Fri 10:56]
> >> <2014-12-11 Thu 12:00 +1w>
> >>
> >> I am sure that customizing the org-todo-repeat-to-state will do the
> trick,
> >> but sadly, I have had the time to learn elisp well enough to perform
> this.
> >>
> >> Any help would be much appreciated.  Please let me know if you have
> >> questions.
> >
> >   ;; TODO state to which a repeater should return the repeating task.
> >   (setq org-todo-repeat-to-state "APPT")
> >
>
> That may not be the best solution however: it would change it globally,
> so *every* repeater would go back to APPT.
>
> C-h v org-todo-repeat-to-state RET says:
>
> ,
> | The TODO state to which a repeater should return the repeating task.
> | By default this is the first task in a TODO sequence, or the previous
> state
> | in a TODO_TYP set.  But you can specify another task here.
> | alternatively, set the :REPEAT_TO_STATE: property of the entry.
> `
>
> so setting the property of the entry might be better.
>
> Personally, I have my appointments in a separate file with its own
> TODO sequence:
>
> #+TODO: APPT | DONE
>
> Nick
>
>
>


-- 
A. Grant Schissler, M.S
GIDP Statistics, University of Arizona
Research Assistant, Lussier Lab


Re: [O] Customizing org-todo-repeat-to-state to return to the current TODO state

2014-11-21 Thread Grant Schissler
That is a nice workaround, but does anyone have any ideas that I could
continue to use my main org file?  Also, what is meant by "the previous
state in TYPO_TYP set"?  Thank you very much for the suggestion.

On Fri, Nov 21, 2014 at 1:13 PM, Nick Dokos  wrote:

> Sebastien Vauban 
> writes:
>
> > Grant Schissler wrote:
> >> I am trying to change the behavior of marking a repeated task as DONE.
> I
> >> would like the task to return to the current TODO state rather than the
> >> first in the TODO sequence or a fixed state.  For example,
> >>
> >> ** APPT Lunch with Mallorie
> >> <2014-12-04 Thu 12:00 +1w>
> >>
> >> Should return to APPT, not TODO or some other predefined state as in the
> >> current behavior:
> >>
> >> TODO Lunch with Mallorie
> >> - State "DONE"   from "APPT"   [2014-11-21 Fri 10:56]
> >> <2014-12-11 Thu 12:00 +1w>
> >>
> >> I am sure that customizing the org-todo-repeat-to-state will do the
> trick,
> >> but sadly, I have had the time to learn elisp well enough to perform
> this.
> >>
> >> Any help would be much appreciated.  Please let me know if you have
> >> questions.
> >
> >   ;; TODO state to which a repeater should return the repeating task.
> >   (setq org-todo-repeat-to-state "APPT")
> >
>
> That may not be the best solution however: it would change it globally,
> so *every* repeater would go back to APPT.
>
> C-h v org-todo-repeat-to-state RET says:
>
> ,
> | The TODO state to which a repeater should return the repeating task.
> | By default this is the first task in a TODO sequence, or the previous
> state
> | in a TODO_TYP set.  But you can specify another task here.
> | alternatively, set the :REPEAT_TO_STATE: property of the entry.
> `
>
> so setting the property of the entry might be better.
>
> Personally, I have my appointments in a separate file with its own
> TODO sequence:
>
> #+TODO: APPT | DONE
>
> Nick
>
>
>


-- 
A. Grant Schissler, M.S
GIDP Statistics, University of Arizona
Research Assistant, Lussier Lab


Re: [O] Customizing org-todo-repeat-to-state to return to the current TODO state

2014-11-21 Thread Grant Schissler
Sorry, I wasn't clear what I meant by "fixed state."  I want to avoid
globally changing the repeat-to-state and flexibly return to the current
state.  Thanks for the suggestion though

On Fri, Nov 21, 2014 at 1:02 PM, Sebastien Vauban 
wrote:

> Grant Schissler wrote:
> > I am trying to change the behavior of marking a repeated task as DONE.  I
> > would like the task to return to the current TODO state rather than the
> > first in the TODO sequence or a fixed state.  For example,
> >
> > ** APPT Lunch with Mallorie
> > <2014-12-04 Thu 12:00 +1w>
> >
> > Should return to APPT, not TODO or some other predefined state as in the
> > current behavior:
> >
> > TODO Lunch with Mallorie
> > - State "DONE"   from "APPT"   [2014-11-21 Fri 10:56]
> > <2014-12-11 Thu 12:00 +1w>
> >
> > I am sure that customizing the org-todo-repeat-to-state will do the
> trick,
> > but sadly, I have had the time to learn elisp well enough to perform
> this.
> >
> > Any help would be much appreciated.  Please let me know if you have
> > questions.
>
>   ;; TODO state to which a repeater should return the repeating task.
>   (setq org-todo-repeat-to-state "APPT")
>
> Best regards,
>   Seb
>
> --
> Sebastien Vauban
>
>
>


-- 
A. Grant Schissler, M.S
GIDP Statistics, University of Arizona
Research Assistant, Lussier Lab


[O] Customizing org-todo-repeat-to-state to return to the current TODO state

2014-11-21 Thread Grant Schissler
Hi Org-mode Users,

I am trying to change the behavior of marking a repeated task as DONE.  I
would like the task to return to the current TODO state rather than the
first in the TODO sequence or a fixed state.  For example,

** APPT Lunch with Mallorie
<2014-12-04 Thu 12:00 +1w>

Should return to APPT, not TODO or some other predefined state as in the
current behavior:

TODO Lunch with Mallorie
- State "DONE"   from "APPT"   [2014-11-21 Fri 10:56]
<2014-12-11 Thu 12:00 +1w>

I am sure that customizing the org-todo-repeat-to-state will do the trick,
but sadly, I have had the time to learn elisp well enough to perform this.

Any help would be much appreciated.  Please let me know if you have
questions.

Thanks for the support and to all those that make org-mode great!
Grant


[O] Customize org-todo-repeat-to-state to return to previous TODO state

2014-11-21 Thread Grant Schissler
Hi Org-mode Users,

I am trying to change the behavior of marking a repeated task as DONE.  I 
would like the task to return to the current TODO state rather than the first 
in 
the TODO sequence or a fixed state.  For example,

** APPT Lunch with Mallorie
<2014-12-04 Thu 12:00 +1w>

should return to APPT, not TODO or some other predefined state as in the 
current behavior:

TODO Lunch with Mallorie
- State "DONE"   from "APPT"   [2014-11-21 Fri 10:56]
<2014-12-11 Thu 12:00 +1w>

I am sure that customizing the org-todo-repeat-to-state will do the trick, but 
sadly, I have had the time to learn elisp well enough to perform this.

Any help would be much appreciated.  Please let me know if you have 
questions.

Thanks for the support and to all those that make org-mode great!
Grant