From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Use default value if a variable is not defined Date: Thu, 11 Oct 2012 11:04:42 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMLFk-0004vs-Re for emacs-orgmode@gnu.org; Thu, 11 Oct 2012 12:04:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMLFb-0008CV-C2 for emacs-orgmode@gnu.org; Thu, 11 Oct 2012 12:04:52 -0400 Received: from mail-oa0-f41.google.com ([209.85.219.41]:36116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMLFb-0008CP-6C for emacs-orgmode@gnu.org; Thu, 11 Oct 2012 12:04:43 -0400 Received: by mail-oa0-f41.google.com with SMTP id k14so2264091oag.0 for ; Thu, 11 Oct 2012 09:04:42 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 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