emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: M <Elwood151@web.de>
Cc: Bastien <bzg@gnu.org>, emacs orgmode-mailinglist <Emacs-orgmode@gnu.org>
Subject: Re: Can I use an already defined agenda view in another agenda command?
Date: Mon, 17 Mar 2014 14:37:33 -0500	[thread overview]
Message-ID: <87iorclipu.fsf@fastmail.fm> (raw)
In-Reply-To: <CF4A3A91.1BD6D%Elwood151@web.de> (M.'s message of "Sat, 15 Mar 2014 17:12:49 +0100")

M <Elwood151@web.de> 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

  parent reply	other threads:[~2014-03-17 19:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87r467xxdq.fsf@bzg.ath.cx>
2014-03-15 16:12 ` Can I use an already defined agenda view in another agenda command? M
2014-03-17  1:27   ` Bastien
2014-03-17 19:37   ` Matt Lundin [this message]
2014-01-21 10:49 Martin Beck
2014-03-12  9:57 ` M

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iorclipu.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=Elwood151@web.de \
    --cc=Emacs-orgmode@gnu.org \
    --cc=bzg@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).