emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Custom agenda - wrong type argument


From: Nathan Neff
Subject: [Orgmode] Re: Custom agenda - wrong type argument
Date: Fri, 16 Apr 2010 16:07:52 -0500



On Wed, Apr 14, 2010 at 10:54 AM, Nathan Neff <address@hidden> 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 "<f5>") 'njn/org-agenda)

Thanks,
--Nate

reply via email to

[Prev in Thread] Current Thread [Next in Thread]