reddit / emacs

Why Org-mode by default doesn't make use of subfolders?

danielkraj · 2022-10-15 17:33
I'm under impression that subfolders are discouraged in org-mode - I can't refile capture notes into a subfolder without explicitly adding it to org-directory. Same with org-agenda. Anything in, for example "work" folder won't be listed until specifically added to org-agenda-files. Which means that renaming one folder now needs to be also changed in 2+ places. Is there a "philosophy" behind that? Is it documented anywhere? I found these blog posts, but I'd really like to see some developers saying that "subfolders are considered harmful": [https://karl-voit.at/2020/01/25/avoid-complex-folder-hierarchies/](https://karl-voit.at/2020/01/25/avoid-complex-folder-hierarchies/) [https://karl-voit.at/2020/05/03/current-org-files/](https://karl-voit.at/2020/05/03/current-org-files/) Why not searching these directories recursively? Or how to work with org mode files outside of org-directory?
lebensterben · 2022-10-15 17:53
if you want answers/insights from its developers, you'd better head to the mail list.
danielkraj · 2022-10-15 18:07
thanks, I will look into that. I'm not a developer myself, so forums like reddit seem more accessible, but at this point I'm desperate enough to go that extra mile. I suppose that an opinion of an experienced org-mode user could be just as helpful, as well. When I mean helpful I mean really **really** helpful.
danderzei · 2022-10-15 20:03
The general idea is to keep all relevant information to find your files in the filename and not rely on folders. As a tangent: [Prot's Denote package](https://protesilaos.com/emacs/denote) is a great example on how to use a file name convention for filename heuristics: `yyyymmddThhmmss--file-name__tag1_tag2.extension` You can store 2^{32} files in one folder and using a file name structure is a very fast way to find stuff. Having said this, not sure why you should not be able to use subfolders, should you choose to.
globalcandyamnesia · 2022-10-15 21:37
You can use (setq org-agenda-files (directory-files-recursively "~/org" org-agenda-file-regexp)) But that will only work for existing files. To refresh the file list every time use (with-eval-after-load 'org (defun org-agenda-files (&rest _) (directory-files-recursively "~/org" org-agenda-file-regexp))) instead
yantar92 · 2022-10-16 01:04
Contacting developers is nothing more than simply dropping us an email. See https://orgmode.org/manual/Feedback.html#Feedback
plm314 · 2022-10-16 01:23
The number of files in a file system depends on the fs itself. Many people have a limit on the total inodes of the order of 10 millions, so creating files eats up a fraction of the available total—same with creating folders. (I like Prot’s package and it’s unlikely that note taking will hit inode limits.)
publicvoit · 2022-10-16 10:19
See my statement on https://www.reddit.com/r/orgmode/comments/y4tykf/comment/isiz4se/?utm_source=reddit&utm_medium=web2x&context=3
danielkraj · 2022-10-16 20:43
on ZFS I think it's even 2^(48) :) . Yes, I've been recommended Denote as well and by the sound of it, it's exactly what I've been looking for. It does let one store notes in subdirectories aside from it's excellent file naming convention by default. It may suit my workflow more.
danielkraj · 2022-10-16 20:46
Thanks a lot, that's really helpful. Can you please explain what you mean by "refresh the file list every time"? Will it require reloading emacs or will this automatically refresh the variable/agenda when files change in the system?
danielkraj · 2022-10-16 20:48
Thanks a lot for the link. I'm new to this, so finding that would otherwise take me a while.
globalcandyamnesia · 2022-10-16 21:04
The latter. I forgot to mention it needs to be evaluated after Org loads. I'll edit my comment.
danielkraj · 2022-10-16 21:09
Thanks and sorry about the duplicate post. I found your writing really helpful when trying to find a way of working with org-mode.
yantar92 · 2022-10-17 00:34
General Emacs rule: check the manual, if it is available (F1 i). Also, see https://www.youtube.com/watch?v=46w9e4GAjsU
radian_ · 2022-10-19 20:26
This doesn't seem to follow symlinks, is there anything I can do ? (the one subdirectory is a symlink to a directory on a remote machine)
globalcandyamnesia · 2022-10-19 21:48
Look at the function documentation for directory-files-recursively, following symlinks should be one of the options.
radian_ · 2022-10-20 11:58
quite right. thank you!.