emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Can I use an already defined agenda view in another agenda comma


From: Matt Lundin
Subject: Re: [O] Can I use an already defined agenda view in another agenda command?
Date: Mon, 17 Mar 2014 14:37:33 -0500
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3 (gnu/linux)

M <address@hidden> writes:

> Salut Bastien,
>
> thanks a lot - that helps a little, however this will only work temporarily
> and already for the next "r" refresh, the combined agendas are not there any
> more, just one, if I am not mistaken.
>
> My question was more targeting in the direction if it could be possible to
> define one basic setup once and then create some different "flavors" of it
> without duplicating the configuration code to have a consistent setup...
>
> Example: 
> I'm having a block agenda which I use during my daily work and which shows
> me the deadlines of today, the appointments of today and the tasks scheduled
> today (and those overdue).
>
> That's fine for the day, but for my daily planning I do once in the morning
> it would be nice to use that same setup, but also see deadlines which are e.
> g. 10 days in the future and the scheduled tasks which will come up the next
> day(s).
>
> So my idea was: i can define the basic setup once, and then "cite" it and
> extend it for other agenda setups.

Here's an example of how something like this could be done:

--8<---------------cut here---------------start------------->8---
(defmacro my-agenda (days)
  `(list 'agenda ""
         (list (list 'org-deadline-warning-days ,days))))

(setq my-next-actions
      '("n" "All next actions" todo "TODO|NOW|NEXT"
        ((org-agenda-todo-ignore-scheduled 'future)
         (org-agenda-todo-ignore-deadlines 'far)
         (org-agenda-dim-blocked-tasks t))))

(setq my-projects
      '("q" "Projects" todo "PROJECT"
        ((org-agenda-todo-ignore-deadlines t)
         (org-agenda-prefix-format " %i %-12:c%l"))))

(setq org-agenda-custom-commands
      `(,my-next-actions
        ,my-projects
        ("k" "Combined"
         (,(cddr my-next-actions)
          ,(cddr my-projects)))
        ("d" "Short deadlines"
         (,(my-agenda 1)))
        ("D" "Long deadlines"
         (,(my-agenda 21)))))
--8<---------------cut here---------------end--------------->8---

Matt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]