Function: vc--with-backend-in-rootdir

vc--with-backend-in-rootdir is a macro defined in vc.el.gz.

Signature

(vc--with-backend-in-rootdir DESC &rest BODY)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
(defmacro vc--with-backend-in-rootdir (desc &rest body)
  (declare (indent 1) (debug (sexp body)))
  ;; Intentionally capture `backend' and `rootdir':
  ;; no need to keep repeating them.
  `(let ((backend (vc-deduce-backend))
         (default-directory default-directory)
	 rootdir)
     (if backend
	 (setq rootdir (vc-call-backend backend 'root default-directory))
       (setq rootdir
             (read-directory-name ,(format "Directory for %s: " desc)))
       (setq backend (vc-responsible-backend rootdir))
       (unless backend
         (error "Directory is not version controlled")))
     (setq default-directory rootdir)
     ,@body))