emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-capture-templates issues
@ 2017-10-04 19:12 Haider Rizvi
  2017-10-04 19:26 ` Kaushal Modi
  0 siblings, 1 reply; 3+ messages in thread
From: Haider Rizvi @ 2017-10-04 19:12 UTC (permalink / raw)
  To: emacs-orgmode

I'm getting the following error, when trying to do an org-capture. 

Debugger entered--Lisp error: (error "Invalid file location: nil")
  signal(error ("Invalid file location: nil"))
  error("Invalid file location: %S" nil)
  org-capture-expand-file((concat org-directory "inbox-gtd.org"))
  org-capture-target-buffer((concat org-directory "inbox-gtd.org"))
  org-capture-set-target-location()
  org-capture(nil)

My org-capture-templates is set as follows for ages: 
(setq org-capture-templates
      '(("t" "Todo" entry (file+headline  (concat org-directory "inbox-gtd.org") "Tasks")
         "* TODO %?\n  %i\n  %a")
         ))

org-directory: "/Users/hrizvi/Google Drive/MyDocs/org/"

With a fully qualified file-name, it works fine:

(setq org-capture-templates
      '(("t" "Todo" entry (file+headline  "/Users/hrizvi/Google Drive/MyDocs/org/inbox-gtd.org" "Tasks")
         "* TODO %?\n  %i\n  %a")
         ))

Reading up org-capture-expand-file, it seems org-directory is
prepended automatically, but it used to work fine in the
past. Flipping back to the older code for org-capture-expand-file
works fine. So I'd say this is a bug!

(emacs-version)
"GNU Emacs 26.0.50 (build 1, x86_64-apple-darwin16.7.0, NS appkit-1504.83 Version 10.12.6 (Build 16G29))
 of 2017-09-13"

(org-version)
"9.1.2"

org is installed from melpa-stable. From packages info: 
org is an installed package.

     Status: Installed in ‘org-20171004/’,
             shadowing a built-in package (unsigned).
    Version: 20171004
    Summary: Outline-based notes management and organizer
Required by: elfeed-org-20170423.128
Other versions: 20171004 (org), 20171002 (gnu), builtin.


-- Haider

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

* Re: Bug: org-capture-templates issues
  2017-10-04 19:12 Bug: org-capture-templates issues Haider Rizvi
@ 2017-10-04 19:26 ` Kaushal Modi
  2017-10-04 19:34   ` Haider Rizvi
  0 siblings, 1 reply; 3+ messages in thread
From: Kaushal Modi @ 2017-10-04 19:26 UTC (permalink / raw)
  To: Haider Rizvi, emacs-orgmode

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

On Wed, Oct 4, 2017 at 3:13 PM Haider Rizvi <harizvi@gmail.com> wrote:

> I'm getting the following error, when trying to do an org-capture.
>
> Debugger entered--Lisp error: (error "Invalid file location: nil")
>   signal(error ("Invalid file location: nil"))
>   error("Invalid file location: %S" nil)
>   org-capture-expand-file((concat org-directory "inbox-gtd.org"))
>   org-capture-target-buffer((concat org-directory "inbox-gtd.org"))
>   org-capture-set-target-location()
>   org-capture(nil)
>
> My org-capture-templates is set as follows for ages:
> (setq org-capture-templates
>       '(("t" "Todo" entry (file+headline  (concat org-directory "
> inbox-gtd.org") "Tasks")
>

Org 9.1 onwards, bare sexp's are now allowed in the template.

From ORG-NEWS:

*** ~org-capture-templates~ no longer accepts S-expressions as file names

Since functions are allowed there, a straightforward way to migrate
is to turn, e.g.,

: (file (sexp))

into

: (file (lambda () (sexp)))

Reading up org-capture-expand-file, it seems org-directory is
> prepended automatically,


correct


> but it used to work fine in the
> past. Flipping back to the older code for org-capture-expand-file
> works fine. So I'd say this is a bug!
>

As mentioned above, this is expected.
-- 

Kaushal Modi

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

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

* Re: Bug: org-capture-templates issues
  2017-10-04 19:26 ` Kaushal Modi
@ 2017-10-04 19:34   ` Haider Rizvi
  0 siblings, 0 replies; 3+ messages in thread
From: Haider Rizvi @ 2017-10-04 19:34 UTC (permalink / raw)
  To: emacs-orgmode

Kaushal Modi <kaushal.modi@gmail.com> writes:

> On Wed, Oct 4, 2017 at 3:13 PM Haider Rizvi <harizvi@gmail.com> wrote:
>  I'm getting the following error, when trying to do an org-capture.
>
> Org 9.1 onwards, bare sexp's are now allowed in the template.
>
> From ORG-NEWS:
>
> *** ~org-capture-templates~ no longer accepts S-expressions as file names

Got it. I missed the news I guess :-)

Thanks for the quick response, Kaushal.

-- Haider

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

end of thread, other threads:[~2017-10-04 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-04 19:12 Bug: org-capture-templates issues Haider Rizvi
2017-10-04 19:26 ` Kaushal Modi
2017-10-04 19:34   ` Haider Rizvi

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