Function: projectile-session--same-root-p

projectile-session--same-root-p is a byte-compiled function defined in projectile.el.

Signature

(projectile-session--same-root-p A B)

Documentation

Return non-nil when project roots A and B denote the same directory.

Identical paths match directly. Otherwise local paths are compared with file-equal-p (so symlinks and abbreviations still match); remote paths never reach file-equal-p, so an unconnected host doesn't trigger a TRAMP round-trip.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-session--same-root-p (a b)
  "Return non-nil when project roots A and B denote the same directory.
Identical paths match directly.  Otherwise local paths are compared with
`file-equal-p' (so symlinks and abbreviations still match); remote paths
never reach `file-equal-p', so an unconnected host doesn't trigger a
TRAMP round-trip."
  (and a b
       (let ((a (file-name-as-directory a))
             (b (file-name-as-directory b)))
         (or (string-equal a b)
             (and (not (or (file-remote-p a) (file-remote-p b)))
                  (file-equal-p a b))))))