Function: tempel-path-templates

tempel-path-templates is a natively compiled function defined in tempel.el.

Signature

(tempel-path-templates)

Documentation

Return templates defined in tempel-path.

Additionally, save any files in tempel-path that have been modified since the last time this function was called. This function can be used as source in tempel-template-sources.

Source Code

;; Defined in /nix/store/b3ibjbs2i12kyhwapibfx6i39f025i85-emacs-packages-deps/share/emacs/site-lisp/elpa/tempel-20260705.1258/tempel.el
(defun tempel-path-templates ()
  "Return templates defined in `tempel-path'.
Additionally, save any files in `tempel-path' that have been modified
since the last time this function was called.  This function can be used
as source in `tempel-template-sources'."
  (when (or (not tempel--path-templates) tempel-auto-reload)
    (let* ((files
            (cl-loop for path in (ensure-list tempel-path)
                     nconc (file-expand-wildcards path t)))
           (timestamps
            (cl-loop
             for f in files collect
             (cons f (time-convert (file-attribute-modification-time
                                    (file-attributes (file-chase-links f)))
                                   'integer)))))
      (unless (equal (car tempel--path-templates) timestamps)
        (setq tempel--path-templates
              (cons timestamps (mapcan #'tempel--file-read files))))))
  (tempel--filter-templates (cdr tempel--path-templates)))