emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* habit-only agenda that doesn't remove tasks when done?
@ 2013-04-26 14:02 Christopher Allan Webber
  2013-07-13  8:14 ` Noorul Islam K M
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Allan Webber @ 2013-04-26 14:02 UTC (permalink / raw)
  To: Emacs-orgmode

Hello,

I'd like to have a habit-only agenda view, if possible, that looks a bit
like:


Morning habits
--------------

life:  TODO Shave               [   * *  *    *         !]  habit::morning:
rsi:   TODO morning stretches   [  **   **    **       *!]  habit::morning:

Night habits
------------

life:  TODO Exercise            [   * *  *    *         !]  habit::night:


... and maybe an other category for cathing the rest.

I'd also like to have these habits not drop off the agenda view when I
move them to DONE if possible.  However, I'm getting the sense that this
isn't possible... it seems like the habit system works with
agendas-only, and there's no way to say "give me an agenda with only
these certain things on it".

Or, alternate option: is it possible to highlight a task with a certain
tag with a certain color?  Like, highlight tags with "morning" as blue,
or something?  I've looked at the way org-habit does it, it looks like
I'd have to do something like the following:

 - add a hook to org-agenda-finalize-hook
 - walk through the agenda and highlight the "morning" tasks manually

I could do that.

The reason for this is I have morning-specific tasks, and I always
narrow just to the morning tasks and then ignore the rest of the habits
for the day.  I'd like to get a view where I see both so I don't forget
to do the rest of the habits for the day.  Yes, I know that sounds
strange :)

There probably aren't easy answers to this, but if there are and I've
been missing them, I'd love to know! :)

 - Chris

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: habit-only agenda that doesn't remove tasks when done?
  2013-04-26 14:02 habit-only agenda that doesn't remove tasks when done? Christopher Allan Webber
@ 2013-07-13  8:14 ` Noorul Islam K M
  2013-11-21 16:25   ` Christopher Allan Webber
  0 siblings, 1 reply; 3+ messages in thread
From: Noorul Islam K M @ 2013-07-13  8:14 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: Emacs-orgmode

Christopher Allan Webber <cwebber@dustycloud.org> writes:

> Hello,
>
> I'd like to have a habit-only agenda view, if possible, that looks a bit
> like:
>
>
> Morning habits
> --------------
>
> life:  TODO Shave               [   * *  *    *         !]  habit::morning:
> rsi:   TODO morning stretches   [  **   **    **       *!]  habit::morning:
>
> Night habits
> ------------
>
> life:  TODO Exercise            [   * *  *    *         !]  habit::night:
>
>
> ... and maybe an other category for cathing the rest.
>
> I'd also like to have these habits not drop off the agenda view when I
> move them to DONE if possible.  However, I'm getting the sense that this
> isn't possible... it seems like the habit system works with
> agendas-only, and there's no way to say "give me an agenda with only
> these certain things on it".

Did you try the following custom command?

              ("h" "Habits" tags-todo "STYLE=\"habit\""
               ((org-agenda-overriding-header "Habits")
                (org-agenda-sorting-strategy
                 '(todo-state-down effort-up category-keep))))

Thanks and Regards
Noorul

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: habit-only agenda that doesn't remove tasks when done?
  2013-07-13  8:14 ` Noorul Islam K M
@ 2013-11-21 16:25   ` Christopher Allan Webber
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Allan Webber @ 2013-11-21 16:25 UTC (permalink / raw)
  To: Noorul Islam K M; +Cc: Emacs-orgmode

noorul@noorul.com writes:

> Christopher Allan Webber <cwebber@dustycloud.org> writes:
>
>> Hello,
>>
>> I'd like to have a habit-only agenda view, if possible, that looks a bit
>> like:
>>
>>
>> Morning habits
>> --------------
>>
>> life:  TODO Shave               [   * *  *    *         !]  habit::morning:
>> rsi:   TODO morning stretches   [  **   **    **       *!]  habit::morning:
>>
>> Night habits
>> ------------
>>
>> life:  TODO Exercise            [   * *  *    *         !]  habit::night:
>>
>>
>> ... and maybe an other category for cathing the rest.
>>
>> I'd also like to have these habits not drop off the agenda view when I
>> move them to DONE if possible.  However, I'm getting the sense that this
>> isn't possible... it seems like the habit system works with
>> agendas-only, and there's no way to say "give me an agenda with only
>> these certain things on it".
>
> Did you try the following custom command?
>
>               ("h" "Habits" tags-todo "STYLE=\"habit\""
>                ((org-agenda-overriding-header "Habits")
>                 (org-agenda-sorting-strategy
>                  '(todo-state-down effort-up category-keep))))
>
> Thanks and Regards
> Noorul

Never noticed this reply till now...

Yes, I tried it; unfortunately it does not show the habit graph, that
only displays in the agenda, and the above version uses tags-todo.

I'd like to be able to show habits, *with* the graph though.  The only
way to do that seems to be through the agenda, and the "match"
parameter of agenda custom commands doesn't seem to support the agenda.

I finally figured out a solution:

#+BEGIN_SRC emacs-lisp
  (defun cwebber/skip-unless-habit ()
    "Checks to see if the style at point is \"habit\""
    (if (not (equal (org-entry-get (point) "STYLE") "habit"))
        ; Skip till the next heading
        (progn (outline-next-heading) (1- (point)))))
  
  (setq org-agenda-custom-commands
        '(("h" "Habits"
           ((agenda
             ""
             ((org-habit-show-all-today t)
              (org-agenda-skip-function 'cwebber/skip-unless-habit)))))))
#+END_SRC

This solution works.  It allows me to pull up just the habits, including
those that have already been done today.

There's only one thing left to do that would make it awesome, and that
would be to make it so that the ones that are now already done said DONE
instead of TODO still.

Other than that, this seems to be kinda working-ish.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-21 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-26 14:02 habit-only agenda that doesn't remove tasks when done? Christopher Allan Webber
2013-07-13  8:14 ` Noorul Islam K M
2013-11-21 16:25   ` Christopher Allan Webber

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).