org-agenda-custom-commands-contexts

org-agenda-custom-commands-contexts is a variable defined in `org-agenda.el'.
Its value is
nil


Documentation:
Alist of custom agenda keys and contextual rules.

For example, if you have a custom agenda command "p" and you
want this command to be accessible only from plain text files,
use this:

'(("p" ((in-file . "\.txt"))))

Here are the available contexts definitions:

in-file: command displayed only in matching files
in-mode: command displayed only in matching modes
not-in-file: command not displayed in matching files
not-in-mode: command not displayed in matching modes
in-buffer: command displayed only in matching buffers
not-in-buffer: command not displayed in matching buffers
[function]: a custom function taking no argument

If you define several checks, the agenda command will be
accessible if there is at least one valid check.

You can also bind a key to another agenda custom command
depending on contextual rules.

'(("p" "q" ((in-file . "\.txt"))))

Here it means: in .txt files, use "p" as the key for the
agenda command otherwise associated with "q". (The command
originally associated with "q" is not displayed to avoid
duplicates.)

You can customize this variable.

This variable was introduced, or its default value was changed, in version 24.3 of Emacs.