Using directories
Thanks for making this, what a great idea!
I put this in my .spacemacs (which in this case will make no difference from a normal .emacs file).
(load-library "find-lisp")
(setq org-randomnote-candidates
(find-lisp-find-files "~/Documents/3 Resources" "\.org$"))
This way org-randomnote will find any file in that folder. This works, but often I get: org-randomnote: Wrong type argument: number-or-marker-p, nil.
I am not sure why this is but thought I'd drop this note for anyone else wondering how to use entire directories rather than individual files as candidates.
Hi there!
Thanks for using the package and for filing this report! I messaged you on Twitter privately, as it seems we have a lot in common. In particular, I noticed that you're using the PARA structure (e.g. "3 Resources") from Tiago Forte with Emacs, and now this package. I notice you're interested in Clojure as well. I hope we can talk more soon!
As far as the error you reported. I changed my local org-randomnote-candidates variable to use find-lisp for particular files, as you suggested.
I also ran into the error you mentioned, and I think I figured out why. The note that I got that message on doesn't have any actual Org headers (e.g. "* 1 Projects"). For org-randomnote's purposes, a "note" is considered a heading in an Org file. In this way, an org file is somewhat analogous to a notebook in Evernote, whereas the individual headings are notes. This is not necessarily intuitive or perfect, but it works well enough to begin with, especially since it can still find such a file randomly.
I can think of a few ways to proceed here, and I'm open to considering whatever ideas you may have, as well.
- I'd like to request that you file a documentation PR to add the Lisp example you suggested, as well as a warning about that error and what it means (extracted from my note above). If you preefer not to or don't have time, I'm happy to do this as well, but I want to give you credit! :)
- Find a way to suppress / mute that particular warning in the code. I seem to recall you can do that but I'm not sure how.
- Plan a different way to configure org-randomnote, to expect notes like this that don't have headings.
1 seems like a no-brainer, and 2 seems easiest to me, but you're welcome to try 3 if you like, or another path entirely. :)
PR #3 has taken the route of 1. I'd like to see 2 implemented in the future, so leaving this issue open for others to take care of that if they like.