Function: denote-link-or-create-with-command

denote-link-or-create-with-command is an autoloaded, interactive and byte-compiled function defined in denote.el.

Signature

(denote-link-or-create-with-command &optional ID-ONLY)

Documentation

Like denote-link-or-create but prompt for a note-making command.

Use this to, for example, call denote-signature when the target file does not exist, so that the newly created note has a signature as part of its file name.

Optional ID-ONLY has the same meaning as in the command denote-link-or-create.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
;;;###autoload
(defun denote-link-or-create-with-command (&optional id-only)
  "Like `denote-link-or-create' but prompt for a note-making command.
Use this to, for example, call `denote-signature' when the target file
does not exist, so that the newly created note has a signature as part
of its file name.

Optional ID-ONLY has the same meaning as in the command
`denote-link-or-create'."
  (declare (interactive-only t))
  (interactive "P")
  (let ((target (denote-file-prompt nil "Select file (RET on no match to create it)" :no-require-match :has-identifier)))
    (unless (file-exists-p target)
      (setq target (denote--command-with-features (denote-command-prompt) :use-file-prompt-as-def-title :ignore-region :save :in-background)))
    (unless (or (denote--file-type-org-extra-p)
                (and buffer-file-name
                     (denote-file-has-supported-extension-p buffer-file-name)))
      (user-error "The current file type is not recognized by Denote"))
    (denote-link target
                 (denote-filetype-heuristics (buffer-file-name))
                 (denote-get-link-description target)
                 id-only)))