From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Can I use an already defined agenda view in another agenda command? Date: Mon, 17 Mar 2014 14:37:33 -0500 Message-ID: <87iorclipu.fsf@fastmail.fm> References: <87r467xxdq.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPdMA-00079T-Cy for Emacs-orgmode@gnu.org; Mon, 17 Mar 2014 15:38:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPdLv-0002hK-7l for Emacs-orgmode@gnu.org; Mon, 17 Mar 2014 15:37:54 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:57986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPdLu-0002h6-Q9 for Emacs-orgmode@gnu.org; Mon, 17 Mar 2014 15:37:39 -0400 In-Reply-To: (M.'s message of "Sat, 15 Mar 2014 17:12:49 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: M Cc: Bastien , emacs orgmode-mailinglist M 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