Function: projectile--file-kind-member-p

projectile--file-kind-member-p is a byte-compiled function defined in projectile.el.

Signature

(projectile--file-kind-member-p REL-PATH SPEC)

Documentation

Return non-nil when REL-PATH belongs to the file kind described by SPEC.

REL-PATH is a path relative to the project root. Membership holds when REL-PATH lives under SPEC's :path prefix (if any) and its basename matches SPEC's :prefix and :suffix (if any).

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile--file-kind-member-p (rel-path spec)
  "Return non-nil when REL-PATH belongs to the file kind described by SPEC.

REL-PATH is a path relative to the project root.  Membership holds when
REL-PATH lives under SPEC's `:path' prefix (if any) and its basename
matches SPEC's `:prefix' and `:suffix' (if any)."
  (let ((path (plist-get spec :path))
        (prefix (plist-get spec :prefix))
        (suffix (plist-get spec :suffix))
        (name (file-name-nondirectory rel-path)))
    ;; `:path' is matched as a directory prefix, so \"app/models/\" does
    ;; not also match \"app/models_archive/x.rb\".
    (and (or (null path)
             (string-prefix-p (file-name-as-directory path) rel-path))
         (or (null prefix) (string-prefix-p prefix name))
         (or (null suffix) (string-suffix-p suffix name)))))