emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: emacs-orgmode@gnu.org
Subject: Re: Best way to implement project specific captures
Date: Fri, 24 Aug 2012 14:25:59 +0200	[thread overview]
Message-ID: <871uiw5ve0.fsf@altern.org> (raw)
In-Reply-To: <wxsjbdmr7e.fsf@news.eternal-september.org> (Richard Riley's message of "Thu, 23 Aug 2012 18:52:05 +0100")

Richard Riley <rileyrg@gmail.com> writes:

> I see Bastien and Carsten are in on the thread too, I'll step back and
> see in what direction this now goes ;) Thanks again for the great
> feature!

This is how it works right now.

For each agenda custom command or capture template, you can define 
a context where it will be accessible.

E.g. you have these custom commands:

(setq org-agenda-custom-commands
      '(("A" "AAAA" ...)
	("B" "BBBB" ...)))

But you don't need "B" in .txt files:

(setq org-agenda-custom-commands-contexts
      '(("B" ((not-in-file . "\.txt")))))

That's it.

Or maybe you want "B" to be accessible with the "A" key (and 
don't want the "A" key):

(setq org-agenda-custom-commands-contexts
      '(("A" "B" ((not-in-file . "\.txt")))))

Or maybe you want "B" to be accessible only in your first two
hours of using Emacs...

(defun less-than-nhours-of-emacs-uptime (&optional n)
 (interactive "P")
 (let ((n (or n 2)))
   (< (time-to-seconds (time-subtract (current-time) before-init-time))
      (* n 3600))))

(setq org-agenda-custom-commands-contexts
      '(("B" (less-then-nhours-of-emacs-uptime))))

Enjoy,

-- 
 Bastien

  reply	other threads:[~2012-08-24 12:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22  3:00 Best way to implement project specific captures Richard Riley
2012-08-22 11:48 ` Sylvain Rousseau
2012-08-22 14:37   ` Bastien
2012-08-22 14:38     ` Bastien
2012-08-22 18:04       ` Sylvain Rousseau
2012-08-23  9:13         ` Bastien
2012-08-23 10:36           ` Carsten Dominik
2012-08-23 11:09             ` Jambunathan K
2012-08-23 15:08             ` Bastien
2012-08-23 17:16             ` Sylvain Rousseau
2012-08-22 21:12   ` Richard Riley
2012-08-22 22:04   ` Richard Riley
2012-08-22 22:54     ` Richard Riley
2012-08-23  8:52       ` Sylvain Rousseau
2012-08-23 17:52         ` Richard Riley
2012-08-24 12:25           ` Bastien [this message]
2012-08-24 19:38             ` Richard Riley
2012-08-24 20:00               ` Bastien
2012-08-24 20:01               ` Bastien
2012-08-26  6:18                 ` Richard Riley

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=871uiw5ve0.fsf@altern.org \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@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).