Function: denote-add-links

denote-add-links is an autoloaded, interactive and byte-compiled function defined in denote.el.

Signature

(denote-add-links REGEXP &optional ID-ONLY)

Documentation

Insert links to all files whose file name matches REGEXP.

Use this command to reference multiple files at once. Particularly useful for the creation of metanotes (read the manual for more on the matter).

Optional ID-ONLY has the same meaning as in denote-link: it inserts links with just the identifier.

Also see denote-link-to-all-files-with-contents.

Key Bindings

Aliases

denote-link-to-all-files-with-regexp

Source Code

;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
;;;###autoload
(defun denote-add-links (regexp &optional id-only)
  "Insert links to all files whose file name matches REGEXP.
Use this command to reference multiple files at once.  Particularly
useful for the creation of metanotes (read the manual for more on the
matter).

Optional ID-ONLY has the same meaning as in `denote-link': it
inserts links with just the identifier.

Also see `denote-link-to-all-files-with-contents'."
  (interactive
   (list
    (denote-files-matching-regexp-prompt "Insert links to files matching REGEXP")
    current-prefix-arg))
  (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"))
  (let ((file-type (denote-filetype-heuristics (buffer-file-name))))
    (if-let* ((files (denote-directory-files regexp :omit-current nil nil :has-identifier)))
        (denote-link--insert-links files file-type id-only)
      (message "No links matching `%s'" regexp))))