Function: consult--with-project-f

consult--with-project-f is a byte-compiled function defined in consult.el.

Signature

(consult--with-project-f BODY)

Documentation

See consult--with-project for documentation.

Source Code

;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult.el
(defun consult--with-project-f (body)
  "See `consult--with-project' for documentation."
  ;; We have to work quite hard here to ensure that the project root is only
  ;; overridden at the current recursion level.  When entering a recursive
  ;; minibuffer session, we should be able to still switch the project.
  (let ((consult-project-function
         (let ((root (or (consult--project-root t) (user-error "No project found")))
               (depth (recursion-depth))
               (orig consult-project-function))
           (lambda (may-prompt)
             (if (= depth (recursion-depth))
                 root
               (funcall orig may-prompt))))))
    (funcall body)))