colonelpanic8 / org-project-capture

Manage org-mode TODOs for your projectile projects
334 stars 33 forks source link

Can't use from a magit buffer #58

Closed Lenbok closed 1 year ago

Lenbok commented 1 year ago

Sometimes I'm in a magit buffer (e.g. status or log) and would like to capture a project TODO. When I try this, I get: org-projectile-project-root-of-filepath: Wrong type argument: stringp, nil

I'm using the following capture template:

  (add-to-list 'org-capture-templates
               (org-projectile-project-todo-entry
                :capture-template "* TODO %?\n"
                :capture-character "p"
                :capture-heading "Project TODO"))
colonelpanic8 commented 1 year ago

Hmmmm. Seems to work for me.

Can you give some more details?

Lenbok commented 1 year ago

I don't particular understand the org capture stuff, but from what I can see/guess it'll try and set the :category property in the occ-context by calling (org-projectile-category-from-file (org-capture-get :original-file)) but the :original-file property of org-capture-plist is nil (presumably since a magit buffer doesn't have a backing file). I wonder how it could possibly work for you?

Lenbok commented 1 year ago

I do think it has worked in the past, so maybe there's been an update to either org or magit that makes this work differently?

colonelpanic8 commented 1 year ago

@Lenbok okay, taking a look at this hopefully today

colonelpanic8 commented 1 year ago

@Lenbok should be fixed now