Skip to content

Change the order of file name components

Our standard file-naming scheme prescribes a specific order for the file name components (The file-naming scheme). Though we provide the user option denote-file-name-components-order to let the user reorder them as they see fit.

The value of this user option is a list of the following symbols:

  • identifier: By default, this is the combination of the date and time. When it is the first on the list, it looks like ‘20240519T073456’ and does not have a component separator of its own due to its unambiguous format. When it is placed anywhere else in the file name, it is prefixed with ‘@@’, so it looks like ‘@@20240519T073456’.
  • signature: This is an arbitrary string that can be used to qualify the file in some way, according to the user’s methodology (e.g. to add a sequence to notes). The string is always prefixed with the == to remain unambiguous.
  • title: This is an arbitrary string which describes the file. It is always prefixed with ‘--’ to be unambiguous.
  • keywords: This is a series of one or more words that succinctly group the file. Multiple keywords are separated by an underscore prefixed to each of them. The file name component is always prefixed with ‘__’.

All four symbols must appear exactly once. Duplicates are ignored. Any missing symbol is added automatically. Note that even though all four symbols must appear in the user option denote-file-name-components-order, actual files may not contain a specific component. For instance, a note without keywords or signature is valid.

Some examples:

emacs-lisp
(setq denote-file-name-components-order '(identifier signature title keywords))
;; => 20240519T07345==hello--this-is-the-title__denote_testing.org

(setq denote-file-name-components-order '(signature identifier title keywords))
;; => ==hello@@20240519T07345--this-is-the-title__denote_testing.org

(setq denote-file-name-components-order '(title signature identifier keywords))
;; => --this-is-the-title==hello@@20240519T07345__denote_testing.org

(setq denote-file-name-components-order '(keywords title signature identifier))
;; => __denote_testing--this-is-the-title==hello@@20240519T07345.org

Also see how to configure the Denote prompts, which affect which components are actually prompted for in creation or renaming commands (The denote-prompts option).

Before deciding on this, please consider the longer-term implications of file names with varying patterns. Consistency makes things predictable and thus easier to find. So pick one order and never touch it again. When in doubt, leave the default file-naming scheme as-is.