Skip to content

Common building blocks for developers or advanced users

Variable denote-date-identifier-format

Format of ID prefix of a note’s filename. The note’s ID is derived from the date and time of its creation (The file-naming scheme).

Variable denote-date-identifier-regexp

Regular expression to match denote-date-identifier-format.

Variable denote-signature-regexp

Regular expression to match the ‘SIGNATURE’ field in a file name.

Variable denote-title-regexp

Regular expression to match the ‘TITLE’ field in a file name (The file-naming scheme).

Variable denote-keywords-regexp

Regular expression to match the ‘KEYWORDS’ field in a file name (The file-naming scheme).

Function denote-date-identifier-p

Return non-nil if ‘IDENTIFIER’ string is a Denote date identifier.

Function denote-file-is-note-p

Return non-nil if ‘FILE’ is an actual Denote note. For our purposes, a note must satisfy file-regular-p and denote-filename-is-note-p.

Function denote-file-has-identifier-p

Return non-nil if ‘FILE’ has a Denote identifier.

Function denote-file-has-denoted-filename-p

Return non-nil if ‘FILE’ respects the file-naming scheme of Denote. This tests the rules of Denote’s file-naming scheme. Sluggification is ignored. It is done by removing all file name components and validating what remains.

Function denote-file-has-signature-p

Return non-nil if ‘FILE’ has a signature.

Function denote-file-has-supported-extension-p

Return non-nil if ‘FILE’ has supported extension. Also account for the possibility of an added ‘.gpg’ suffix. Supported extensions are those implied by denote-file-type.

Function denote-file-is-writable-and-supported-p

Return non-nil if ‘FILE’ is writable and has supported extension.

Function denote-file-type-extensions

Return all file type extensions in denote-file-types.

Variable denote-encryption-file-extensions

List of strings specifying file extensions for encryption.

Function denote-file-type-extensions-with-encryption

Derive denote-file-type-extensions plus denote-encryption-file-extensions.

Function denote-get-file-extension

Return extension of ‘FILE’ with dot included. Account for denote-encryption-file-extensions. In other words, return something like ‘.org.gpg’ if it is part of the file, else return ‘.org’.

Function denote-get-file-extension-sans-encryption

Return extension of ‘FILE’ with dot included and without the encryption part. Build on top of denote-get-file-extension though always return something like ‘.org’ even if the actual file extension is ‘.org.gpg’.

Functions denote-infer-keywords-from-files

Return list of keywords in denote-directory-files. With optional ‘FILES-MATCHING-REGEXP’, only extract keywords from the matching files. Otherwise, do it for all files. Keep any duplicates. Users who do not want duplicates should refer to the functions denote-keywords.

Function denote-keywords

Return appropriate list of keyword candidates. If denote-infer-keywords is non-nil, infer keywords from existing notes and combine them into a list with denote-known-keywords. Else use only the latter set of keywords (Standard note creation). In the case of keyword inferrence, use optional ‘FILES-MATCHING-REGEXP’, to extract keywords only from the matching files. Otherwise, do it for all files. Filter inferred keywords with the user option denote-keywords-to-not-infer-regexp.

Function denote-keywords-sort

Sort ‘KEYWORDS’ if denote-sort-keywords is non-nil. ‘KEYWORDS’ is a list of strings, per denote-keywords-prompt.

Function denote-keywords-combine

Combine ‘KEYWORDS’ list of strings into a single string. Keywords are separated by the underscore character, per the Denote file-naming scheme.

Function denote-valid-date-p

Return ‘DATE’ as a valid date. A valid ‘DATE’ is a value that can be parsed by either decode-time or date-to-time .Those functions signal an error if ‘DATE’ is a value they do not recognise. If ‘DATE’ is nil, return nil.

Function denote-directories

Return list of paths to the variable denote-directory.

Function denote-directories-get-common-root

Return the closest common root of the denote-directories.

Function denote-directory-get-files

Return list with full path of valid files in variable denote-directory. Consider files that satisfy denote-file-has-identifier-p and are not backups.

Function denote-directory-files

Return list of absolute file paths in variable denote-directory. Files that match denote-excluded-files-regexp are excluded from the list. Files only need to have an identifier. The return value may thus include file types that are not implied by denote-file-type. With optional ‘FILES-MATCHING-REGEXP’, restrict files to those matching the given regular expression. With optional ‘OMIT-CURRENT’ as a non-nil value, do not include the current Denote file in the returned list. With optional ‘TEXT-ONLY’ as a non-nil value, limit the results to text files that satisfy denote-file-is-note-p. With optional ‘EXCLUDE-REGEXP’ exclude the files that match the given regular expression. This is done after ‘FILES-MATCHING-REGEXP’ and ‘OMIT-CURRENT’ have been applied. With optional ‘HAS-IDENTIFIER’ as a non-nil value, limit the results to files that have an identifier.

Function denote-directory-subdirectories

Return list of subdirectories in variable denote-directory. Omit dotfiles (such as .git) unconditionally. Also exclude whatever matches denote-excluded-directories-regexp. Note that the denote-directory accepts a directory-local value for what we call “silos” (Maintain separate directories for notes).

Function denote-id-to-date

Convert ‘IDENTIFIER’ to a date string of the form ‘YYYY-MM-DD’.