colonelpanic8 / org-project-capture

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

How to set path for specific projects in org-projectile-per-project mode ? #39

Closed scarletsky closed 6 years ago

scarletsky commented 6 years ago

Hi, I am a org-projectile-per-project user. I'd like to add an org file to the root of my personal projects. That is:

.
├── .git
├── package.json
├── src
└── TODOs.org

But in my company projects, I need to add it to sub folders.

├── .git
├── backend
└── frontend
    ├── src
    ├── package.json
    └── TODOs.org

How can I set it ?

colonelpanic8 commented 6 years ago

@scarletsky This is not technically possible through org-projectile-per-project, but it should be relatively easy to write a custom org-projectile-strategy to do this.

colonelpanic8 commented 6 years ago

@scarletsky Actually this should be really trivial to support with the current strategy. I'll add something to do this.

scarletsky commented 6 years ago

Wow, thanks for your quick replay ! I've checked the commit, I think the usage should be

(org-projectile-per-project-filepath
 (lambda (path)
   (if (string-equal path "/sp-project")
       "OTHER.org"
     "TODO.org"))))

Right ?

colonelpanic8 commented 6 years ago

@scarletsky

(setq org-projectile-per-project-filepath
 (lambda (path)
   (if (string-equal path "/sp-project")
       "special_location_TODOS/TODO.org"
     "TODO.org"))))

Yes, although I'm assuming you'll want more than just "Is it equal to this one specific project" as your condition (or maybe that is all you need)?

scarletsky commented 6 years ago

@IvanMalison Yes, I can extend the sp-projects list by myself. Thanks. 😄