Function: eca--paths-nested-p

eca--paths-nested-p is a natively compiled function defined in eca-util.el.

Signature

(eca--paths-nested-p A B)

Documentation

Return non-nil when paths A and B are equal or nested.

Two paths are nested when one is an ancestor directory of the other. Both paths are normalized via file-truename and compared with a trailing slash to avoid prefix false-positives
(e.g. "/foo" matching "/foobar").

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-util.el
(defun eca--paths-nested-p (a b)
  "Return non-nil when paths A and B are equal or nested.
Two paths are nested when one is an ancestor directory of the
other.  Both paths are normalized via `file-truename' and
compared with a trailing slash to avoid prefix false-positives
\(e.g. \"/foo\" matching \"/foobar\")."
  (let ((a (file-name-as-directory (file-truename (expand-file-name a))))
        (b (file-name-as-directory (file-truename (expand-file-name b)))))
    (or (string= a b)
        (string-prefix-p a b)
        (string-prefix-p b a))))