emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-capture-expand-file: Invalid file location: nil
@ 2017-11-04 11:23 Xi Shen
  2017-11-04 21:23 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Xi Shen @ 2017-11-04 11:23 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1133 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: org-capture-expand-file: Invalid file location: nil
  2017-11-04 11:23 org-capture-expand-file: Invalid file location: nil Xi Shen
@ 2017-11-04 21:23 ` Nicolas Goaziou
  2017-11-05  2:27   ` Xi Shen
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2017-11-04 21:23 UTC (permalink / raw)
  To: Xi Shen; +Cc: emacs-orgmode@gnu.org

Hello,

Xi Shen <davidshen84@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'.

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: org-capture-expand-file: Invalid file location: nil
  2017-11-04 21:23 ` Nicolas Goaziou
@ 2017-11-05  2:27   ` Xi Shen
  0 siblings, 0 replies; 3+ messages in thread
From: Xi Shen @ 2017-11-05  2:27 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]

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 <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Xi Shen <davidshen84@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'.
>
> > 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
>

[-- Attachment #2: Type: text/html, Size: 2133 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-05  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-04 11:23 org-capture-expand-file: Invalid file location: nil Xi Shen
2017-11-04 21:23 ` Nicolas Goaziou
2017-11-05  2:27   ` Xi Shen

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).