Function: consult--project-root

consult--project-root is a natively compiled function defined in consult.el.

Signature

(consult--project-root &optional MAY-PROMPT)

Documentation

Return project root as absolute path.

When no project is found and MAY-PROMPT is non-nil ask the user.

Source Code

;; Defined in /nix/store/6higv2v1wk916v4ynnybyrdkfy2gq44d-emacs-packages-deps/share/emacs/site-lisp/elpa/consult-20261004.957/consult.el
(defun consult--project-root (&optional may-prompt)
  "Return project root as absolute path.
When no project is found and MAY-PROMPT is non-nil ask the user."
  ;; Preserve this-command across project selection,
  ;; such that `consult-customize' continues to work.
  (let ((this-command this-command))
    (when-let* ((root (and consult-project-function
                           (funcall consult-project-function may-prompt))))
      (expand-file-name root))))