Subject: bug#12492: Acknowledgement (24.2.50; Open vc-dir buffer easier and faster)

From: Dmitry Gutov <[email-masked]>
Date: Mon, 1 Jul 2019 15:56:42 +0300

On 01.07.2019 11:02, Andreas Schwab wrote:
> On Sep 23 2012, Dmitry Gutov <[email-masked]> wrote:
> 
>> +(defun vc-root-dir ()
> 
> This is already defined in vc.el.

True. The patch predated the introduction of that function.

Here's the code that I have been using for the last few years:

(defun vc-dir-quick ()
   (interactive)
   (require 'vc-dir)
   (let* ((file (or buffer-file-name default-directory))
          (backend (vc-responsible-backend file))
          (dir (vc-call-backend backend 'root file)))
     (let (pop-up-windows)
       (pop-to-buffer (vc-dir-prepare-status-buffer "*vc-dir*" dir 
backend)))
     (unless (derived-mode-p 'vc-dir-mode)
       (let ((use-vc-backend backend))
         (vc-dir-mode)))))