[Top][All Lists]

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

[Orgmode] Re: how to change the set of agenda org files between custom a

From: Rainer Stengele
Subject: [Orgmode] Re: how to change the set of agenda org files between custom agenda commands
Date: Thu, 25 Sep 2008 14:00:35 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080708 Thunderbird/ Mnenhy/

Carsten Dominik wrote:
On Sep 24, 2008, at 11:25 PM, Rainer Stengele wrote:

Dan Griswold wrote:
Rainer Stengele <address@hidden> writes:
I am struggling to switch the set of used agenda org files between
different custom agenda commands.

I tried something like

(setq org-agenda-custom-commands
    ("k" . "Kundenbezogene / Ketegoriebezogene TODOs ...")
       ("ka" tags-todo "CATEGORY=\"ADMIN\"")
       ("kP" tags-todo "CATEGORY=\"PRIVAT\""
     ((org-agenda-files (quote ("~/org/PRIVAT/PRIVAT.org")))))
Playing with customize I came up with this possibility:
(setq org-agenda-custom-commands
    ("k" . "Kundenbezogene / Ketegoriebezogene TODOs ...")
       ("ka" tags-todo "CATEGORY=\"ADMIN\"")
       ("kP" tags-todo "CATEGORY=\"PRIVAT\""
Will that do it?

Dan, thank you. I somehow does and doesn't.
After using the command I get the "private" entries.
After using another command analogous to this it seems I cannot reset the org-agenda-files variable. Looks like it only adds files to it?
I played around a lot but could not get it to function as wanted.

Hi Rainer, Dan

I just tested this, with

(setq org-agenda-custom-commands
      '(("ka" "aaa" alltodo ""
    ("kb" "bbb" alltodo ""

with small files a.org and b.org containing just one TODO entry, and of course my full suite of TODO entries available with `C-c a t'.

And then I do

C-c a t
C-c a a
C-c a b
C-c a t

and it all works just fine, going back end forth between these in any sequence.....

Anyway, the syntax is quite complex.
I wonder if some more examples for changing agenda files when executing custom commands would be helpful. Anyone else who wants to see Agenden at home from different sets of agenda files?

I think a good way is also to keep the list of agenda files in a file, like
~/.agenda_files_home and ~/.agenda_files_work.

The you can have different sets of files, and switch by making org-agenda-files

(defun org-my-toggle-agenda-file-set ()
 (if (equal org-agenda-files "~/.agenda_files_work")
     (setq org-agenda-files "~/.agenda_files_home")
   (setq org-agenda-files "~/.agenda_files_work"))
 (message "Using %s" org-agenda-files))

- Carsten

Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.

Hi all,

I found the problem. I used "org-agenda-directory" instead of org-agenda-files.
Not recognising that this variable doesn't seem to exist (did it ever exist?)
I assumed I can use it to indicate the org files folder.

With org-agenda-files everything works perfectly.

I now have about 48 custom commands (partly of course hierarchical) and with
dynamically changing the set of org files I really feel I have control over my 

I am very happy with org!

Thank you both!


reply via email to

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