Control the default sort of a query buffer
The user option denote-query-sorting controls the order of matching files in a query buffer (buffers that use the denote-query-mode. The applies to the buffer that is produced by query links for file contents, backlinks, and the denote-grep command:
By default (a nil value), no sorting of matching files is performed. Files are displayed in the order they are returned by the search program (which often, but not always, means they are sorted by file name).
The denote-query-sorting can be set to a symbol among those listed in the value of the variable denote-sort-components to sort by the given file name component (The file-naming scheme). The symbol ‘random’ produces a random order each time, while ‘last-modified’ relies on the file system to sort by the modification time.
The denote-query-sorting can also be set to the symbol of a function. In that case, the given function is used to perform the sorting. This is for advanced users, who may refer to the documentation of the denote-sort-files for the technicalities.
Whatever the value of denote-query-sorting, users may change the sorting of query buffers on demand by calling the command denote-query-sort-last-search (Interact with the links buffer).