/org-randomnote

Find a random note in your Org-Mode files

Primary LanguageEmacs Lisp

https://melpa.org/packages/org-randomnote-badge.svg

org-randomnote intends to provide a way to bring randomness into your Org-Mode workflow. It does so by implementing the “Random Note” functionality popularized by Tiago Forte with Evernote in Emacs Org-Mode.

Some people use Random Note functionality daily, as a way to revisit nearly-forgotten but potentially-useful notes, or to spark creative insights by bringing older subjects into mind with new subjects.

Installation and Configuration

You can now use Melpa as usual: M-x package-install and then org-randomnote.

You can also use this example configuration, using John Wiegley’s use-package:

(use-package org-randomnote
  :ensure t
  :bind ("C-c r" . org-randomnote))

Then run eval-buffer on your .emacs, or restart Emacs.

In Spacemacs, you can put the use-package snippet above into dotspacemacs/user-config, and add org-randomnote to your dotspacemacs-additional-packages:

dotspacemacs-additional-packages '(
                                  org-randomnote
                                   )

Then use SPC-f-e-R to synchronize your Spacemacs and load the package.

Usage

Once loaded, run the interactive command org-randomnote.

You can configure which files org-randomnote selects from with the variable org-randomnote-candidates. It defaults to using org-agenda-files, but you can use any list of files:

(setq org-randomnote-candidates '("~/org/todo.org"))

You can also configure the behavior with which org-randomnote opens files. By default, it simply moves to a random note’s header. However, you can also configure it to use an indirect buffer, like so:

(setq org-randomnote-open-behavior 'indirect-buffer)

To configure org-randomnote to use entire directories as sources, you can use this snippet:

(load-library "find-lisp")
(setq org-randomnote-candidates
      (find-lisp-find-files "~/Documents/3 Resources" "\.org$"))

This way org-randomnote will find any org file in that folder.

However, be aware that you may see the warning org-randomnote: Wrong type argument: number-or-marker-p, nil. This warning will crop up when org-randomnote brings up a file that 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.