From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrea crotti Subject: Agenda restrict to buffer Date: Wed, 11 Jul 2012 11:23:21 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sou4z-0000bY-L9 for emacs-orgmode@gnu.org; Wed, 11 Jul 2012 06:23:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sou4t-0002qB-E8 for emacs-orgmode@gnu.org; Wed, 11 Jul 2012 06:23:33 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:46827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sou4s-0002fg-Pr for emacs-orgmode@gnu.org; Wed, 11 Jul 2012 06:23:27 -0400 Received: by lbjn8 with SMTP id n8so1825543lbj.0 for ; Wed, 11 Jul 2012 03:23:23 -0700 (PDT) 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: emacs-orgmode@gnu.org I never quite understood how to pass arguments to org-agenda without using it interactively.. I want a simple thing, a command that shows the agenda with the TODO entries from a given file So supposing the buffer "projects.org" is open I tried this: (defun my-org-agenda () (interactive) (switch-to-buffer (get-buffer "projects.org")) (org-agenda :arg 'agenda :restriction '<)) which complains for Wrong number of arguments: (lambda (&optional arg keys restriction) "Dispatch agenda commands to collect entries to the agenda buffer. Any suggestions?