From mboxrd@z Thu Jan  1 00:00:00 1970
From: andrea crotti <andrea.crotti.0@gmail.com>
Subject: Agenda restrict to buffer
Date: Wed, 11 Jul 2012 11:23:21 +0100
Message-ID: <CAF_E5JbMwWC4qV0TcnUJfYRodXGo4r=m5GzuEmeGOJJXNP-DpQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Return-path: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org>
Received: from eggs.gnu.org ([208.118.235.92]:38586)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andrea.crotti.0@gmail.com>) 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 <andrea.crotti.0@gmail.com>) 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 <andrea.crotti.0@gmail.com>) 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 <emacs-orgmode@gnu.org>; Wed, 11 Jul 2012 03:23:23 -0700 (PDT)
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=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?