Function: consult--project-root

consult--project-root is a byte-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 ~/.emacs.d/elpa/consult-20260805.1130/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))))