emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nathan Neff <nathan.neff@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Use default value if a variable is not defined
Date: Thu, 11 Oct 2012 11:04:42 -0500	[thread overview]
Message-ID: <CAC=HedAr5KshVp2E_h-LZOhZ_1HE927z+8j0_0g-j1T7mwZ-Tw@mail.gmail.com> (raw)

Hello,

I'm trying to create a function that will tell org-capture
dynamically where to put the captured item.

I have it almost working -- where I'm getting hung up on is
with basic Emacs lisp.  I want to basically implement this
pseudo code:

IF I have defined a variable called njn/current-q-file then
        (find-file njn/current-q-file)
ELSE
       (find-file ("questions.org")))



However, if I do not define my njn/current-q-file then
I get a "Symbol's value as variable is void" error when Emacs starts up.

How do I test for the existence (and non-nil ness of a variable in Emacs)

Thanks,
--Nate

             reply	other threads:[~2012-10-11 16:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 16:04 Nathan Neff [this message]
2012-10-12 15:52 ` Use default value if a variable is not defined Ivan Andrus

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='CAC=HedAr5KshVp2E_h-LZOhZ_1HE927z+8j0_0g-j1T7mwZ-Tw@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).