From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xi Shen Subject: Re: org-capture-expand-file: Invalid file location: nil Date: Sun, 05 Nov 2017 02:27:24 +0000 Message-ID: References: <87d14xpwl7.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c14ad0eb3c86c055d3314cf" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBAew-00033A-Ht for Emacs-orgmode@gnu.org; Sat, 04 Nov 2017 22:27:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBAev-0005Cv-EO for Emacs-orgmode@gnu.org; Sat, 04 Nov 2017 22:27:38 -0400 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:46895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eBAev-0005C7-6I for Emacs-orgmode@gnu.org; Sat, 04 Nov 2017 22:27:37 -0400 Received: by mail-lf0-x230.google.com with SMTP id g70so7018631lfl.3 for ; Sat, 04 Nov 2017 19:27:37 -0700 (PDT) In-Reply-To: <87d14xpwl7.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: "emacs-orgmode@gnu.org" --94eb2c14ad0eb3c86c055d3314cf Content-Type: text/plain; charset="UTF-8" Hi Nicolas, Sorry, I missed this one. (global-set-key (kbd "C-c c") 'org-capture) OK, thanks for the tip. The problem lies in the "org-capture-templates" settings. I think in the past, it accept a "nil" argument. Now it expects an empty string. Replacing nil with empty string solves my problem. Regards, David On Sun, Nov 5, 2017 at 5:23 AM Nicolas Goaziou wrote: > 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 > --94eb2c14ad0eb3c86c055d3314cf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Nicolas,

Sorry, I missed this one.

(global-set-key (kbd "C-c c") 'org-ca= pture)

OK, thanks for the tip. The problem lie= s in the "org-capture-templates" settings. I think in the past, i= t accept a "nil" argument. Now it expects an empty string. Replac= ing nil with empty string solves my problem.


<= /div>
Regards,
David


On Sun, Nov 5, 2017 at 5:23 AM Nicolas Go= aziou <mail@nicolasgoaziou.fr<= /a>> wrote:
Hello,

Xi Shen <
davi= dshen84@gmail.com> writes:

> When I do C-c c, I got an error:

I don't see any "c" template in your `org-capture-templates&#= 39;.

> 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
>=C2=A0 =C2=A0 (quote
>=C2=A0 =C2=A0 =C2=A0(("t" "Task" entry
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(file+headline nil "Tasks")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0"* TODO %? %^g")
>=C2=A0 =C2=A0 =C2=A0 ("q" "Quick note" entry
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(file+datetree nil)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0"* [%<%H:%M>] %?"))))

Have you tried to specify an actual filename, or the empty string,
instead of using nil? Both `file+headline' and `file+datetree' expe= ct
some file to operate on.

Regards,

--
Nicolas Goaziou
--94eb2c14ad0eb3c86c055d3314cf--