weirdNox / org-noter

Emacs document annotator, using Org-mode
GNU General Public License v3.0
1.08k stars 101 forks source link

org-noter-notes-search-path #146

Closed AtomicNess123 closed 3 years ago

AtomicNess123 commented 3 years ago

I was wondering if org-noter-notes-search-path can be set to be the current folder and subfolders where the PDF is located.

auroranil commented 3 years ago

org-noter-notes-search-path is a customizable variable, which means you can set it to any value you want.

(setq org-noter-notes-search-path '("~/path/to/pdfs") allows you to set it to any path you like, and you can do this in your configuration file to set it on startup.

To set the path to the current folder and subfolders at the path you are viewing the PDF file, this is what you need to do:

  1. Find a function which returns a list of all subfolder paths given a folder directory as input (since org-noter says in its documentation that it checks folders non-recursively)
  2. Determine path of PDF file you are currently viewing in Emacs
  3. Use that path to set org-noter-notes-search-path by adding hook to pdf-view-mode-hook. Have a look at my comment in another issue to see how you can do that: https://github.com/weirdNox/org-noter/issues/142#issuecomment-821916509

Personally, I would rather keep all PDF files in the same directory, and use fuzzy search to quickly find the PDF I want. Using this approach means that I can set this customisable variable once without having to add a hook function to dynamically set it, which is a bonus.

AtomicNess123 commented 3 years ago

Thanks for the excellent guidelines. I see the point of organizing all PDFs in one folder, but in my configuration I keep projects in different folders sometimes created on spot, so it's not convenient to have to add folders to the path everytime.