From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Re: Custom agenda - wrong type argument Date: Fri, 16 Apr 2010 16:07:52 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0383871771==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2slq-0007pO-IM for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 17:08:14 -0400 Received: from [140.186.70.92] (port=37056 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2slo-0007nv-1p for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 17:08:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2slY-0003Kp-1I for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 17:07:57 -0400 Received: from mail-pw0-f41.google.com ([209.85.160.41]:47028) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2slX-0003Ka-NX for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 17:07:55 -0400 Received: by pwi2 with SMTP id 2so3052565pwi.0 for ; Fri, 16 Apr 2010 14:07:54 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============0383871771== Content-Type: multipart/alternative; boundary=001636e1f8f122d7400484610161 --001636e1f8f122d7400484610161 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Apr 14, 2010 at 10:54 AM, Nathan Neff wrote: > I'm trying to build a custom agenda that works with the current buffer. > > I've succeeded in getting the agenda to display with the > current buffer like this: > > (setq org-agenda-custom-commands > (quote ( > ("c" "Current Buffer" agenda "" ((org-agenda-files (list > (buffer-file-name))))) > ("f" "Home Buffer" agenda "" ((org-agenda-files > '("~/Documents/personal/nate.org")))) > ) > ) > ) > > However, when I view the agenda for the current buffer (by pressing "c", > every key I press gives me "Wrong type argument: stringp, nil". > > I fixed it! I found a fairly slick workaround for the problem. Before calling (org-agenda), I set a variable called njn/current-buffer-file-name, and refer to that variable in my custom agenda view. (defun njn/org-agenda () (interactive) (setq njn/current-buffer-name (buffer-file-name)) (org-agenda) ) I have an example of the fixed and broken custom agenda commands below: (setq org-agenda-custom-commands '( ("c" "Current Buffer" agenda "" ((org-agenda-files (list njn/current-buffer-name))) ) ("x" "This doesn't Work. It gets the right data, but wont let you issue any other agenda commands" agenda "" ((org-agenda-files (list (buffer-file-name)))) ) ) ) Instead of calling (org-agenda), I just call (njn/org-agenda) (global-set-key (kbd "") 'njn/org-agenda) Thanks, --Nate --001636e1f8f122d7400484610161 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Wed, Apr 14, 2010 at 10:54 AM, Nathan= Neff <nathan= .neff@gmail.com> wrote:
I'm trying to build a custom agenda that works with the current buffer.=

I've succeeded in getting the agenda to display with the
cur= rent buffer like this:

(setq org-agenda-custom-commands
=A0=A0= =A0=A0=A0 (quote (
=A0=A0=A0=A0=A0=A0=A0=A0 ("c" "Current Buffer" agenda &= quot;" ((org-agenda-files (list (buffer-file-name)))))
=A0=A0=A0=A0= =A0=A0=A0=A0 ("f" "Home Buffer" agenda "" ((o= rg-agenda-files '("~/Documents/personal/nate.org"))))
=A0=A0=A0=A0=A0=A0=A0=A0 )
=A0=A0=A0=A0=A0 )
)

However, when I= view the agenda for the current buffer (by pressing "c",
ever= y key I press gives me "Wrong type argument: stringp, nil".

I fixed it!=A0 I found a fairly slick workaround for the problem.
Before= calling (org-agenda), I set a variable called njn/current-buffer-file-name= , and refer to that variable in my custom agenda view.

(defun njn/or= g-agenda ()
=A0 (interactive)
=A0 (setq njn/current-buffer-name (buffer-file-name))<= br>=A0 (org-agenda)
)

I have an example of the fixed and broken c= ustom agenda commands below:

(setq org-agenda-custom-commands
=A0= =A0=A0=A0=A0 '(
=A0=A0=A0=A0=A0=A0=A0=A0 ("c" "Current Buffer" agenda &= quot;"
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ((org-agenda-files (list njn/= current-buffer-name)))
=A0=A0=A0=A0=A0=A0=A0=A0 )
=A0=A0=A0=A0=A0=A0= =A0=A0 ("x" "This doesn't Work.=A0 It gets the right dat= a, but wont
=A0=A0=A0=A0=A0 let you issue any other agenda commands" agenda "= "
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ((org-agenda-files (list (buffer-f= ile-name))))
=A0=A0=A0=A0=A0=A0=A0=A0 )
=A0=A0=A0=A0=A0=A0 )
)
=
Instead of calling (org-agenda), I just call (njn/org-agenda)

(global-set-key (kbd "<f5>") 'njn/org-agenda)
Thanks,
--Nate
--001636e1f8f122d7400484610161-- --===============0383871771== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0383871771==--