Function: denote--file-has-backlinks-p

denote--file-has-backlinks-p is a natively compiled function defined in denote.el.

Signature

(denote--file-has-backlinks-p FILE)

Documentation

Return non-nil if FILE has backlinks.

Source Code

;; Defined in /nix/store/yld6spsps5sfn9w4rjyhkvqlvdgsmvpq-emacs-packages-deps/share/emacs/site-lisp/elpa/denote-4.2.3/denote.el
(defun denote--file-has-backlinks-p (file)
  "Return non-nil if FILE has backlinks."
  (when-let* ((id (denote-retrieve-filename-identifier file))
              (files (denote-directory-files nil :omit-current :text-only)))
    (catch 'has-backlinks
      (dolist (file files)
        (with-temp-buffer
          (insert-file-contents file)
          (goto-char (point-min))
          (when (search-forward (format "[denote:%s]" id) nil t)
            (throw 'has-backlinks t)))))))