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:52:08 -0700

Rolf Ade <rolf@pointsman.de> wrote:
> Since emacs show me in the mode line of that buffers, that the file is
> under version control, there must be a way with elisp to determine, if
> the file shown in a buffer is under version control. How could that be
> done?

You could use `vc-backend', e.g. (vc-backend (buffer-file-name)).

`save-some-buffers' accepts an argument PRED; you could also use
`vc-backend' there:

(save-some-buffers
 nil
 (lambda () (vc-backend (buffer-file-name))))

That way you don't need to loop through the buffer-list yourself.

        John



reply via email to

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