org-project-capture icon indicating copy to clipboard operation
org-project-capture copied to clipboard

not auto selecting current project

Open rileyrg opened this issue 1 year ago • 3 comments

I was expecting this to detect the .project in my current directory and default to the TODO there. It doesnt. Instead, I get a completing read of all projects project is aware of. Is there something I'm missing?

  (use-package org-project-capture
    :custom
    (org-project-capture-default-backend  (make-instance 'org-project-capture-project-backend))
    :config
    (org-project-capture-per-project)
    :bind  (:map project-prefix-map ("t" . org-project-capture-project-todo-completing-read)))

rileyrg avatar Jan 20 '25 18:01 rileyrg

Yes. There is a function that generates a capture template for you. If you want to capture to the current project, you should use org-capture with that capture template.

colonelpanic8 avatar Jan 21 '25 15:01 colonelpanic8

There is also org-project-capture-capture-for-current-project

colonelpanic8 avatar Jan 21 '25 15:01 colonelpanic8

Yes. There is a function that generates a capture template for you. If you want to capture to the current project, you should use org-capture with that capture template.

Sorry, but I'm not sure what you mean there. A function that generates a capture template? What function? If you have an example that would be super.

There is also org-project-capture-capture-for-current-project

If I bind that to project's map it says "Wrong type argument: stringp, nil" when I launch it.

apply: Wrong type argument: stringp, (vc Git "~/development/projects/cmake/cmake-3.31.3-tutorial-source/Step4/")

Note that this directory has a ".project" file but the git root is further up the chain.

Apologies if this is all simple, but I'm not getting it all and am not really familiar with the make-instance approach.

  (use-package org-project-capture
    :demand t
    :config
    (setq org-project-capture-default-backend (make-instance 'org-project-capture-project-backend))
    (setq org-project-capture-strategy (make-instance 'org-project-capture-per-project-strategy))
    :bind  (:map project-prefix-map ("t" .  org-project-capture-capture-for-current-project)))


rileyrg avatar Jan 21 '25 16:01 rileyrg