From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-capture-expand-file: Invalid file location: nil Date: Sat, 04 Nov 2017 22:23:16 +0100 Message-ID: <87d14xpwl7.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eB5uS-0005XS-11 for Emacs-orgmode@gnu.org; Sat, 04 Nov 2017 17:23:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eB5uR-0005hy-6f for Emacs-orgmode@gnu.org; Sat, 04 Nov 2017 17:23:20 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:55743) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eB5uR-0005hL-0T for Emacs-orgmode@gnu.org; Sat, 04 Nov 2017 17:23:19 -0400 In-Reply-To: (Xi Shen's message of "Sat, 04 Nov 2017 11:23:51 +0000") 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" To: Xi Shen Cc: "emacs-orgmode@gnu.org" Hello, Xi Shen writes: > When I do C-c c, I got an error: I don't see any "c" template in your `org-capture-templates'. > org-capture-expand-file: Invalid file location: nil > > But (org-capture-expand-file "") returns the expected value. And the file > does exist. But (org-capture-expand-file nil) raise an error. This seems expected according to the docstring. > So I guess the function was given an erroneous value. > > My relevant settings are: > > (org-capture-templates > (quote > (("t" "Task" entry > (file+headline nil "Tasks") > "* TODO %? %^g") > ("q" "Quick note" entry > (file+datetree nil) > "* [%<%H:%M>] %?")))) Have you tried to specify an actual filename, or the empty string, instead of using nil? Both `file+headline' and `file+datetree' expect some file to operate on. Regards, -- Nicolas Goaziou