The backlinks’ buffer
[ Older versions of Denote had two types of formatting for the backlinks’ buffer. As part of version ‘4.0.0’, we only support the standard Xref view which shows matches in their context. The user option denote-backlinks-show-context is thus removed. ]
The command denote-backlinks (alias denote-show-backlinks-buffer) produces a bespoke buffer which displays backlinks to the current note (Interact with the links buffer). A “backlink” is a link back to the present entry. Backlinks can be generated for any file type that has a Denote file-naming scheme, such as PDFs, images, and videos, as well as the regular plain text files.
The backlinks’ buffer is, in essence, the equivalent of a Unix grep command across the denote-directory (Speed up backlinks’ buffer creation?). It groups matches by file name, while it displays the line on which a link to the current file occurs together with its context. It looks like this (plus the appropriate fontification):
Backlinks to "On being honest" (20220614T130812)
------------------------------------------------
20220614T145606--let-this-glance-become-a-stare__journal.txt
37: growing into it: [[denote:20220614T130812][On being honest]].
64: As I said in [[denote:20220614T130812][On being honest]] I have never
20220616T182958--feeling-butterflies-in-your-stomach__journal.txt
62: indifference. In [[denote:20220614T130812][On being honest]] I alludedNote that the width of the lines in the context depends on the underlying file. In the above example, the lines are split at the fill-column. Long lines will show up just fine. Also note that the built-in user option xref-truncation-width can truncate long lines to a given maximum number of characters.
As with query links, the backlinking facility uses Emacs’ built-in Xref infrastructure (Adding a query link). On some operating systems, the user may need to add certain executables to the relevant environment variable (Why do I get “Search failed with status 1” when I search for backlinks?).
The placement of the backlinks’ buffer is subject to the user option denote-backlinks-display-buffer-action. Due to the nature of the underlying display-buffer mechanism, this inevitably is a relatively advanced feature. By default, the backlinks’ buffer is displayed below the current window.
Backlinks to the current file can also be visited by using the minibuffer completion interface with the denote-find-backlink command or the more powerful denote-find-backlink-with-location (Visiting linked files via the minibuffer).