Function: projectile--file-kind-key

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

Signature

(projectile--file-kind-key REL-PATH SPEC)

Documentation

Return REL-PATH's resource key for the kind SPEC, or nil.

Uses SPEC's :key-fn when set, otherwise projectile--file-kind-default-key. A :key-fn that signals an error is treated as no match (nil), so one misbehaving user-supplied key-fn can't break related-file navigation for the whole project type.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile--file-kind-key (rel-path spec)
  "Return REL-PATH's resource key for the kind SPEC, or nil.

Uses SPEC's `:key-fn' when set, otherwise
`projectile--file-kind-default-key'.  A `:key-fn' that signals an error
is treated as no match (nil), so one misbehaving user-supplied key-fn
can't break related-file navigation for the whole project type."
  (if-let* ((key-fn (plist-get spec :key-fn)))
      (condition-case nil
          (funcall key-fn rel-path)
        (error nil))
    (projectile--file-kind-default-key rel-path spec)))