emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nathan Neff <nathan.neff@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Custom agenda - wrong type argument
Date: Fri, 16 Apr 2010 16:07:52 -0500	[thread overview]
Message-ID: <k2y211769421004161407wf4c3df62s65bfb874cf5162c7@mail.gmail.com> (raw)
In-Reply-To: <z2u211769421004140854k4a39a6b6g9a84d94480c33a7b@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1534 bytes --]

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
> 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

[-- Attachment #1.2: Type: text/html, Size: 2164 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

      reply	other threads:[~2010-04-16 21:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14 15:54 Custom agenda - wrong type argument Nathan Neff
2010-04-16 21:07 ` Nathan Neff [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=k2y211769421004161407wf4c3df62s65bfb874cf5162c7@mail.gmail.com \
    --to=nathan.neff@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).