From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Baier Subject: Re: org-agenda-custom-command for property AND TODO state (for a cooking guide :) ) Date: Tue, 15 Apr 2014 09:34:46 +0200 Message-ID: <87sipfcag9.fsf@gmail.com> References: <874n1vel17.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZxuT-00036s-Pq for emacs-orgmode@gnu.org; Tue, 15 Apr 2014 03:36:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WZxuK-0006TZ-PA for emacs-orgmode@gnu.org; Tue, 15 Apr 2014 03:36:01 -0400 Received: from mail-ee0-x229.google.com ([2a00:1450:4013:c00::229]:59842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZxuK-0006TU-Hk for emacs-orgmode@gnu.org; Tue, 15 Apr 2014 03:35:52 -0400 Received: by mail-ee0-f41.google.com with SMTP id t10so7427046eei.0 for ; Tue, 15 Apr 2014 00:35:51 -0700 (PDT) In-Reply-To: (Xebar Saram's message of "Tue, 15 Apr 2014 07:12:34 +0300") 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: Xebar Saram Cc: org mode 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 " c") 'my-cooking-sparse-tree-main) #+end_src HTH, -- Alexander Baier