Function: denote--file-has-front-matter-p

denote--file-has-front-matter-p is a byte-compiled function defined in denote.el.

Signature

(denote--file-has-front-matter-p FILE FILE-TYPE)

Documentation

Return non-nil if FILE has at least one front-matter line, given FILE-TYPE.

This is checked against its front matter definition. If the front matter definition has no lines, this function returns non-nil.

Source Code

;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
(defun denote--file-has-front-matter-p (file file-type)
  "Return non-nil if FILE has at least one front-matter line, given FILE-TYPE.

This is checked against its front matter definition.  If the front matter
definition has no lines, this function returns non-nil."
  (let* ((front-matter (denote--front-matter file-type))
         (file-content (with-current-buffer (find-file-noselect file) (buffer-string)))
         (components-in-template (denote--get-front-matter-components-order front-matter file-type))
         (components-in-file (denote--get-front-matter-components-order file-content file-type)))
    (or (null components-in-template)
        (seq-intersection components-in-template components-in-file))))