Function: projectile--project-leading-token

projectile--project-leading-token is a byte-compiled function defined in projectile.el.

Signature

(projectile--project-leading-token PATH)

Documentation

Return the first word of PATH's directory name, or nil.

Single characters aren't words worth grouping on, so they're skipped.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile--project-leading-token (path)
  "Return the first word of PATH\\='s directory name, or nil.
Single characters aren't words worth grouping on, so they're skipped."
  (seq-find (lambda (token) (>= (length token) 2))
            (split-string (downcase (file-name-nondirectory
                                     (directory-file-name path)))
                          "[-_. ]+" t)))