Skip to content

Visiting linked files via the minibuffer

Denote has a major-mode-agnostic mechanism to collect all linked file references in the current buffer and return them as an appropriately formatted list. This list can then be used in interactive commands. The denote-find-link is such a command. It uses minibuffer completion to visit a file that is linked to from the current note. The candidates have the correct metadata, which is ideal for integration with other standards-compliant tools (Extending Denote). For instance, a package such as ‘marginalia’ will display accurate annotations, while the ‘embark’ package will be able to work its magic such as in exporting the list into a filtered Dired buffer (i.e. a familiar Dired listing with only the files of the current minibuffer session).

To visit backlinks to the current note via the minibuffer, use denote-find-backlink. This is an alternative to placing backlinks in a dedicated buffer (The backlinks’ buffer).

As an alternative to denote-find-backlink, the command denote-find-backlink-with-location shows the complete results of all backlinks in their context, grouped by file. It prompts to pick one among them, using minibuffer completion, and then jumps to the corresponding file at that exact location where the link is.

Think of the denote-find-backlink-with-location as the minibuffer-centric variant of the backlinks buffer: the backlinks buffer sticks around, whereas this one is only available for the duration of the command. Depending on the scenario, one is more appropriate than the other.