help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List of buffers under version control?


From: John Mastro
Subject: Re: List of buffers under version control?
Date: Thu, 28 Jul 2016 12:58:11 -0700

John Mastro <john.b.mastro@gmail.com> wrote:
> You could use `vc-backend', e.g. (vc-backend (buffer-file-name)).

If the version control system in question isn't supported by VC, an
alternative would be to use `locate-dominating-file'. Something like
(using Git as an example, even though VC obviously does support it):

(save-some-buffers
 nil
 (lambda ()
   (let ((file (buffer-file-name)))
     (and file (locate-dominating-file file ".git")))))

        John



reply via email to

[Prev in Thread] Current Thread [Next in Thread]