Function: projectile-related-files-fn

projectile-related-files-fn is a byte-compiled function defined in projectile.el.

Signature

(projectile-related-files-fn PROJECT-TYPE)

Documentation

Find relative file based on PROJECT-TYPE.

Combines the type's hand-written related-files-fn (or the projectile-project-related-files-fn override) with a related-files-fn compiled from its file-kinds declaration, if any. When both are present they are merged into a list of functions so declarative and hand-written relations coexist.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-related-files-fn (project-type)
  "Find relative file based on PROJECT-TYPE.

Combines the type's hand-written `related-files-fn' (or the
`projectile-project-related-files-fn' override) with a related-files-fn
compiled from its `file-kinds' declaration, if any.  When both are
present they are merged into a list of functions so declarative and
hand-written relations coexist."
  (let ((custom (or projectile-project-related-files-fn
                    (projectile-project-type-attribute project-type 'related-files-fn)))
        (file-kinds (projectile-project-type-attribute project-type 'file-kinds)))
    (if (null file-kinds)
        custom
      (let ((kinds-fn (projectile--file-kinds-related-files-fn file-kinds)))
        (cond
         ((null custom) kinds-fn)
         ((functionp custom) (list custom kinds-fn))
         ((consp custom) (append custom (list kinds-fn)))
         (t (error "Unsupported value type of :related-files-fn")))))))