Function: denote
denote is an autoloaded, interactive and byte-compiled function
defined in denote.el.
Signature
(denote &optional TITLE KEYWORDS FILE-TYPE DIRECTORY DATE TEMPLATE SIGNATURE IDENTIFIER)
Documentation
Create a new note with the appropriate metadata and file name.
Run the denote-after-new-note-hook after creating the new note and
return its path. Before returning the path, determine what needs to be
done to the buffer, in accordance with the user option denote-kill-buffers.
When called interactively, the metadata and file name are prompted
according to the value of denote-prompts.
When called from Lisp, all arguments are optional.
- TITLE is a string or a function returning a string.
- KEYWORDS is a list of strings. The list can be empty or the
value can be set to nil.
- FILE-TYPE is a symbol among those described in the user option
denote-file-type(var)/denote-file-type(fun).
- DIRECTORY is a string representing the path to either the
value of the variable denote-directory(var)/denote-directory(fun) or a subdirectory
thereof. The subdirectory must exist: Denote will not create
it. If DIRECTORY does not resolve to a valid path, the first
item in the variable denote-directory(var)/denote-directory(fun) is used instead.
- DATE is a string representing a date like 2022-06-30 or a date
and time like 2022-06-16 14:30. A nil value or an empty string
is interpreted as the current-time.
- IDENTIFIER is a string identifying the note. It should have the
format of the variable denote-date-identifier-format, like
20220630T1430000.
- TEMPLATE is a symbol which represents the key of a cons cell in
the user option denote-templates. The value of that key is
inserted to the newly created buffer after the front matter.
- SIGNATURE is a string.
Key Bindings
Aliases
Source Code
;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
;;;###autoload
(defun denote (&optional title keywords file-type directory date template signature identifier)
"Create a new note with the appropriate metadata and file name.
Run the `denote-after-new-note-hook' after creating the new note and
return its path. Before returning the path, determine what needs to be
done to the buffer, in accordance with the user option `denote-kill-buffers'.
When called interactively, the metadata and file name are prompted
according to the value of `denote-prompts'.
When called from Lisp, all arguments are optional.
- TITLE is a string or a function returning a string.
- KEYWORDS is a list of strings. The list can be empty or the
value can be set to nil.
- FILE-TYPE is a symbol among those described in the user option
`denote-file-type'.
- DIRECTORY is a string representing the path to either the
value of the variable `denote-directory' or a subdirectory
thereof. The subdirectory must exist: Denote will not create
it. If DIRECTORY does not resolve to a valid path, the first
item in the variable `denote-directory' is used instead.
- DATE is a string representing a date like 2022-06-30 or a date
and time like 2022-06-16 14:30. A nil value or an empty string
is interpreted as the `current-time'.
- IDENTIFIER is a string identifying the note. It should have the
format of the variable `denote-date-identifier-format', like
20220630T1430000.
- TEMPLATE is a symbol which represents the key of a cons cell in
the user option `denote-templates'. The value of that key is
inserted to the newly created buffer after the front matter.
- SIGNATURE is a string."
(interactive
(pcase-let* ((`(,title ,keywords ,file-type ,directory ,date ,identifier ,template ,signature)
(denote--creation-get-note-data-from-prompts)))
(list title keywords file-type directory date template signature identifier)))
(pcase-let* ((`(,title ,keywords ,file-type ,directory ,date ,identifier ,template ,signature)
(denote--creation-prepare-note-data title keywords file-type directory date identifier template signature))
(note-path (denote--prepare-note title keywords date identifier directory file-type template signature)))
(denote--keywords-add-to-history keywords)
(setq denote-current-data
(list
(cons 'title title)
(cons 'keywords keywords)
(cons 'signature signature)
(cons 'directory directory)
(cons 'date date)
(cons 'id identifier)
(cons 'file-type file-type)
(cons 'template template)))
(run-hooks 'denote-after-new-note-hook)
(denote--handle-save-and-kill-buffer 'creation note-path nil)
note-path))