emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to do this org-agenda command?
@ 2009-02-07  2:38 Richard KLINDA
  2009-02-07  9:48 ` Manish
  0 siblings, 1 reply; 9+ messages in thread
From: Richard KLINDA @ 2009-02-07  2:38 UTC (permalink / raw)
  To: emacs-orgmode

Hi, I need an org-agenda-custom-commands section for the following: list
all TODO entries, that are either scheduled for that day OR have #A
priority.  Is it possible?  Thanks in advance!

-- 
Richard

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

* Re: how to do this org-agenda command?
  2009-02-07  2:38 how to do this org-agenda command? Richard KLINDA
@ 2009-02-07  9:48 ` Manish
  2009-02-07 12:03   ` Richard KLINDA
  0 siblings, 1 reply; 9+ messages in thread
From: Manish @ 2009-02-07  9:48 UTC (permalink / raw)
  To: Richard KLINDA; +Cc: emacs-orgmode

On Sat, Feb 7, 2009 at 8:08 AM, Richard KLINDA wrote:
> Hi, I need an org-agenda-custom-commands section for the following: list
> all TODO entries, that are either scheduled for that day OR have #A
> priority. Is it possible? Thanks in advance!

--8<---------------cut here---------------start------------->8---
(setq org-agenda-custom-commands
      (quote (("r" "Richard's Daily Agenda"
               ((tags-todo "PRIORITY=\"A\"" nil)
                (agenda "" nil)) nil nil))))
--8<---------------cut here---------------end--------------->8---

It lists an "A" priority task twice if it is scheduled for today. May be
a skip condition can be added..

-- 
Manish

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

* Re: how to do this org-agenda command?
  2009-02-07  9:48 ` Manish
@ 2009-02-07 12:03   ` Richard KLINDA
  2009-02-07 12:22     ` Manish
  2009-02-07 14:13     ` Matthew Lundin
  0 siblings, 2 replies; 9+ messages in thread
From: Richard KLINDA @ 2009-02-07 12:03 UTC (permalink / raw)
  To: emacs-orgmode

>>>>> Regarding 'Re: how to do this org-agenda command?'; Manish adds:


  > --8<---------------cut here---------------start------------->8---
  > (setq org-agenda-custom-commands
  >       (quote (("r" "Richard's Daily Agenda"
  >                ((tags-todo "PRIORITY=\"A\"" nil)
  >                 (agenda "" nil)) nil nil))))
  > --8<---------------cut here---------------end--------------->8---

  > It lists an "A" priority task twice if it is scheduled for
  > today. May be a skip condition can be added..

Thanks Manish, would it be possible to have this as a single tags-todo
section?  Ideally I would like to have something like this, so the most
important tasks can stay visually together at the top of my daily agenda
stuff:

(tags-todo "PRIORITY=\"A\"|SCHEDULED=t|CLOCKED=t" nil)

-- 
Richard

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

* Re: Re: how to do this org-agenda command?
  2009-02-07 12:03   ` Richard KLINDA
@ 2009-02-07 12:22     ` Manish
  2009-02-07 12:54       ` Richard KLINDA
  2009-02-07 14:13     ` Matthew Lundin
  1 sibling, 1 reply; 9+ messages in thread
From: Manish @ 2009-02-07 12:22 UTC (permalink / raw)
  To: Richard KLINDA; +Cc: emacs-orgmode

On Sat, Feb 7, 2009 at 5:33 PM, Richard KLINDA wrote:
>>>>>> Regarding 'Re: how to do this org-agenda command?'; Manish adds:
>
>
> > --8<---------------cut here---------------start------------->8---
> > (setq org-agenda-custom-commands
> >    (quote (("r" "Richard's Daily Agenda"
> >        ((tags-todo "PRIORITY=\"A\"" nil)
> >         (agenda "" nil)) nil nil))))
> > --8<---------------cut here---------------end--------------->8---
>
> > It lists an "A" priority task twice if it is scheduled for
> > today. May be a skip condition can be added..
>
> Thanks Manish, would it be possible to have this as a single tags-todo
> section? Ideally I would like to have something like this, so the most
> important tasks can stay visually together at the top of my daily agenda
> stuff:

How about blanking out the header between the two blocks.  Does
this appeal to you?

--8<---------------cut here---------------start------------->8---
(setq org-agenda-custom-commands
      (quote (("r" "Richard's Daily Agenda"
               ((agenda "" nil)
                (tags-todo "PRIORITY=\"A\""
                           ((org-agenda-overriding-header "")))) nil nil))))
--8<---------------cut here---------------end--------------->8---

> (tags-todo "PRIORITY=\"A\"|SCHEDULED=t|CLOCKED=t" nil)

Obviously this is not a valid syntax (as of now) but what do you mean by
CLOCKED=t?

-- 
Manish

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

* Re: Re: how to do this org-agenda command?
  2009-02-07 12:22     ` Manish
@ 2009-02-07 12:54       ` Richard KLINDA
  2009-02-07 13:13         ` Manish
  0 siblings, 1 reply; 9+ messages in thread
From: Richard KLINDA @ 2009-02-07 12:54 UTC (permalink / raw)
  To: emacs-orgmode

>>>>> Regarding 'Re: [Orgmode] Re: how to do this org-agenda command?'; Manish adds:


  >> tags-todo section? Ideally I would like to have something like
  >> this, so the most important tasks can stay visually together at the
  >> top of my daily agenda stuff:

  > How about blanking out the header between the two blocks.  Does this
  > appeal to you?

Hmm, not bad, thanks.  I need more time to experiment with it.

  > --8<---------------cut here---------------start------------->8---
  > (setq org-agenda-custom-commands
  >       (quote (("r" "Richard's Daily Agenda"
  >                ((agenda "" nil)
  >                 (tags-todo "PRIORITY=\"A\""
  >                            ((org-agenda-overriding-header "")))) nil
  >                            nil))))
  > --8<---------------cut here---------------end--------------->8---

  >> (tags-todo "PRIORITY=\"A\"|SCHEDULED=t|CLOCKED=t" nil)

  > Obviously this is not a valid syntax (as of now) but what do you
  > mean by CLOCKED=t?

Yes it is confusing, I meant CLOCKED=t for the item that is currently
clocked in.

-- 
Udv, Richard

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

* Re: Re: how to do this org-agenda command?
  2009-02-07 12:54       ` Richard KLINDA
@ 2009-02-07 13:13         ` Manish
  2009-02-07 14:31           ` Richard KLINDA
  0 siblings, 1 reply; 9+ messages in thread
From: Manish @ 2009-02-07 13:13 UTC (permalink / raw)
  To: Richard KLINDA; +Cc: emacs-orgmode

On Sat, Feb 7, 2009 at 6:24 PM, Richard KLINDA wrote:
[...]
>
> >> (tags-todo "PRIORITY=\"A\"|SCHEDULED=t|CLOCKED=t" nil)
>
> > Obviously this is not a valid syntax (as of now) but what do you
> > mean by CLOCKED=t?
>
> Yes it is confusing, I meant CLOCKED=t for the item that is currently
> clocked in.

How about switching the TODO state when you clock in to a task and adding a
block to the custom agenda to inlude tasks with that state?

--8<---------------cut here---------------start------------->8---
(setq org-clock-in-switch-to-state "STARTED")
--8<---------------cut here---------------end--------------->8---

-- 
Manish

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

* Re: Re: how to do this org-agenda command?
  2009-02-07 12:03   ` Richard KLINDA
  2009-02-07 12:22     ` Manish
@ 2009-02-07 14:13     ` Matthew Lundin
  2009-02-07 14:26       ` Richard KLINDA
  1 sibling, 1 reply; 9+ messages in thread
From: Matthew Lundin @ 2009-02-07 14:13 UTC (permalink / raw)
  To: Richard KLINDA; +Cc: emacs-orgmode


Hi Richard,

> Thanks Manish, would it be possible to have this as a single tags-todo
> section?  Ideally I would like to have something like this, so the most
> important tasks can stay visually together at the top of my daily agenda
> stuff:

As Manish said, I would recommend automatically changing to a todo state
when you clock in an item.

--8<---------------cut here---------------start------------->8---
(setq org-clock-in-switch-to-state "STARTED")
--8<---------------cut here---------------end--------------->8---

Then you could create a custom agenda command like the following:

--8<---------------cut here---------------start------------->8---
(setq org-agenda-custom-commands
      '(("n" "Now" tags-todo "PRIORITY=\"A\"|SCHEDULED=\"<today>\"|TODO=\"STARTED\"")))
--8<---------------cut here---------------end--------------->8---

Hope this helps.
Matt

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

* Re: Re: how to do this org-agenda command?
  2009-02-07 14:13     ` Matthew Lundin
@ 2009-02-07 14:26       ` Richard KLINDA
  0 siblings, 0 replies; 9+ messages in thread
From: Richard KLINDA @ 2009-02-07 14:26 UTC (permalink / raw)
  To: emacs-orgmode

>>>>> Regarding 'Re: [Orgmode] Re: how to do this org-agenda command?'; Matthew Lundin adds:


  > As Manish said, I would recommend automatically changing to a todo
  > state when you clock in an item.

  > --8<---------------cut here---------------start------------->8---
  > (setq org-clock-in-switch-to-state "STARTED") 
  > --8<---------------cut here---------------end--------------->8---

I don't really like this because I already use state for other purposes.

  > Then you could create a custom agenda command like the following:

  > --8<---------------cut here---------------start------------->8---
  > (setq org-agenda-custom-commands
  >       '(("n" "Now" tags-todo
  >       "PRIORITY=\"A\"|SCHEDULED=\"<today>\"|TODO=\"STARTED\"")))
  > --8<---------------cut here---------------end--------------->8---

Wow, that's super.  I searched for "<today>" in the documentation and
came upon "7.3 Property searches", I've missed that very important part
of the documentation until now.

-- 
Richard

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

* Re: Re: how to do this org-agenda command?
  2009-02-07 13:13         ` Manish
@ 2009-02-07 14:31           ` Richard KLINDA
  0 siblings, 0 replies; 9+ messages in thread
From: Richard KLINDA @ 2009-02-07 14:31 UTC (permalink / raw)
  To: emacs-orgmode

>>>>> Regarding 'Re: [Orgmode] Re: how to do this org-agenda command?'; Manish adds:


  > How about switching the TODO state when you clock in to a task and
  > adding a block to the custom agenda to inlude tasks with that state?

  > --8<---------------cut here---------------start------------->8---
  > (setq org-clock-in-switch-to-state "STARTED")
  > --8<---------------cut here---------------end--------------->8---

Thanks, in the end I wrote a hackish org-agenda-skip-function for my
needs.  Thank you for your input.

,----
| (defun rk-org-agenda-skip-not-interesting ()
|   "Skip not interesting TODO entries, only keep:
|   - [#A] priority entries,
|   - scheduled for today entries,
|   - entries that are clocked in.
| Ripped from org-agenda-skip-if function."
|   (let (beg end m)
|     (org-back-to-heading t)
|     (setq beg (point)
| 	  end (progn (outline-next-heading) (1- (point))))
|     (goto-char beg)
|     (and (and
|           ;; CLOCKED IN entries
|           (not (save-excursion
|                  (when (re-search-forward "^ +CLOCK: \\[.*?\\]$" end t)
|                    (beginning-of-line)
|                    (not (re-search-forward "--" (line-end-position) t))
|                    )))
|           ;; PRIORITY [#A] entries
|           (not (save-excursion
|                  (re-search-forward "\\[#A\\]" end t)))
|           ;; SCHEDULED FOR (TO)DAY entries
|           (not (save-excursion
|                  (when (re-search-forward org-ts-regexp
|                                           end t)
|                    (calendar-date-equal (org-date-to-gregorian
|                                          (time-to-days
|                                           (org-time-string-to-time (match-string 0))))
|                                         date
|                                         )))))
|          end)))
`----

Usage example:

,----
|           ...
|           (alltodo "" ((org-agenda-skip-function
|                         'rk-org-agenda-skip-not-interesting)))
|           ...
`----

-- 
Richard

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

end of thread, other threads:[~2009-02-07 14:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-07  2:38 how to do this org-agenda command? Richard KLINDA
2009-02-07  9:48 ` Manish
2009-02-07 12:03   ` Richard KLINDA
2009-02-07 12:22     ` Manish
2009-02-07 12:54       ` Richard KLINDA
2009-02-07 13:13         ` Manish
2009-02-07 14:31           ` Richard KLINDA
2009-02-07 14:13     ` Matthew Lundin
2009-02-07 14:26       ` Richard KLINDA

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).