From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rolf Ade Newsgroups: gmane.emacs.help Subject: Re: List of buffers under version control? Date: Thu, 28 Jul 2016 21:31:26 +0200 Organization: Me Message-ID: <87r3adv9td.fsf@linux-qg7d.fritz.box> References: <877fc6wrv7.fsf@linux-qg7d.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1469734567 31159 80.91.229.3 (28 Jul 2016 19:36:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jul 2016 19:36:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 28 21:36:05 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bSr6C-0007oi-5C for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Jul 2016 21:36:04 +0200 Original-Received: from localhost ([::1]:55327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSr65-0004PN-NB for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Jul 2016 15:35:57 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-X-Trace: individual.net xFAlhuXi9Dpn0+BNOBR8agvbi8rF7wlk3Q27vLbQP3+gUHRzs= Cancel-Lock: sha1:J6HyJTkJSpTmLBQzof1V64/X5RE= sha1:PXeLwef+b9d0UHrvquHoYzFAOFc= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:218664 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110974 Archived-At: Yuri Khan writes: > On Thu, Jul 28, 2016 at 7:03 AM, Rolf Ade wrote: > >> I often edit files in emacs, that are under version control. It should >> not, but it happens, that I haven#t save-buffer some buffer, while >> check-in on the cmd line. > > Normally, when staging a commit, for each unsaved file, you will see a > lock (.#) and possibly a recovery file (##) in the > same directory. This is your signal that not all files are saved. As > soon as you save the file, its lock and recovery file disappear. Well, this proposes an enlargement of my work-flow. Do one step more: run ls and look at the output, before I check-in. Still, a simple ls would not be sufficent. Often, there are a few modified files spread over sub-directories. A `find -name '#*'` instead of a simple ls could help, but has other drawbacks. Most important, this would only work if I check-in only in the root directory of the version controled sub tree, which is I step, that is currently not needed. Yes, a bit shell scripting within the wrapper around the scm command line tool could find the root of the source tree and do the find there. But even then other open and modified files out of that sub tree, that are not under version control (temporary input or output files, for example) would give false positives. With emacsclient -e I'm able to ask the running emacs. Something like this (loop for buffer in (buffer-list) until (if (buffer-file-name buffer) (buffer-modified-p buffer) nil) finally return (if (buffer-modified-p buffer) 1 0)) is a skeleton of what I want. The missing piece is that I only want to look at buffers under version control, not on all buffers, that are visiting a file, as above. In other words, I'm searching for a (buffer-is-under-version-control-p buffer) function. How could that be done?