emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alexander Baier <lexi.baier@gmail.com>
To: Xebar Saram <zeltakc@gmail.com>
Cc: org mode <emacs-orgmode@gnu.org>
Subject: Re: org-agenda-custom-command for property AND TODO state (for a cooking guide :) )
Date: Tue, 15 Apr 2014 09:34:46 +0200	[thread overview]
Message-ID: <87sipfcag9.fsf@gmail.com> (raw)
In-Reply-To: <CAOQHXPpBg4P8MGek3JDNwGYQzgpt14z9RKZeOJ3gdAN-xzbrRg@mail.gmail.com> (Xebar Saram's message of "Tue, 15 Apr 2014 07:12:34 +0300")

On 2014-04-15 06:12 Xebar Saram wrote:
> thx alot  Alexander!
>
> this worked. any idea how to bind this to a key?
> ie have  C-c / m   +TODO="TODO"+TYPE="main" bound to F1-c   etc..

You create an interactive function that simply calls
`org-match-sparse-tree' with the right match string:

#+begin_src emacs-lisp
  (defun my-cooking-sparse-tree-main ()
    (interactive)
    (org-match-sparse-tree t "+TODO=\"TODO\"+TYPE=\"main\""))
#+end_src

And now you can simply bind this command (thats what an interactive
function is called) to whatever you like:

#+begin_src emacs-lisp
  (define-key org-mode-map (kbd "<f1> c") 'my-cooking-sparse-tree-main)
#+end_src

HTH,
-- 
 Alexander Baier

      reply	other threads:[~2014-04-15  7:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 13:45 org-agenda-custom-command for property AND TODO state (for a cooking guide :) ) Xebar Saram
2014-04-14 20:03 ` Alexander Baier
2014-04-15  4:12   ` Xebar Saram
2014-04-15  7:34     ` Alexander Baier [this message]

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=87sipfcag9.fsf@gmail.com \
    --to=lexi.baier@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=zeltakc@gmail.com \
    /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).