Re: [O] org-capture-expand-file: Invalid file location: nil

2017-11-04 Thread Xi Shen
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
>


Re: [O] org-capture-expand-file: Invalid file location: nil

2017-11-04 Thread Nicolas Goaziou
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



[O] org-capture-expand-file: Invalid file location: nil

2017-11-04 Thread Xi Shen
Hi,

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

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. 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>] %?"

(setq org-default-notes-file (concat org-directory "/.notes"))

I did not change my configurations for a long time. Maybe some of them are
outdated?


Thanks,
David