From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?q?Fran=E7ois_Fleuret?= Newsgroups: gmane.emacs.help Subject: Re: How to test if a directory is under version control ? Date: 06 Nov 2003 12:30:59 +0100 Organization: Noos Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87znf991jg.fsf@noos.fr> References: <87k76fypyo.fsf@noos.fr> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1068119520 5916 80.91.224.253 (6 Nov 2003 11:52:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Nov 2003 11:52:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 06 12:51:58 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AHigA-0004I9-00 for ; Thu, 06 Nov 2003 12:51:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AHicT-00064a-FG for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Nov 2003 06:48:09 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!teaser.fr!noos.fr!not-for-mail Original-Newsgroups: gnu.emacs.help X-Attribution: FF X-Url: http://www-rocq.inria.fr/~fleuret User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Lines: 31 Original-NNTP-Posting-Date: 06 Nov 2003 11:31:42 GMT Original-NNTP-Posting-Host: 81.67.18.90 Original-X-Trace: 1068118302 news.noos.fr 21114 81.67.18.90 Original-X-Complaints-To: abuse@noos.fr Original-Xref: shelby.stanford.edu gnu.emacs.help:117913 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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 Xref: main.gmane.org gmane.emacs.help:13852 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13852 Hi, Stefan Monnier wrote on 05 Nov 2003 15:15:07 MET: > VC has two related operations: `responsible-p' and `could-register'. > [ ... snip snip ...] Thanks Stefan. I finally wrote the following: >> ;; This function displays an alarm if the file we are editing is not >> ;; under CVS while the directory is. >> >> (require 'vc-cvs) >> >> (defun check-under-cvs () >> (when (and buffer-file-name >> (not (vc-cvs-registered buffer-file-name)) >> (vc-cvs-responsible-p buffer-file-name)) >> (message "*Warning* %s is not under CVS" buffer-file-name) >> )) >> >> (add-hook 'find-file-hooks 'check-under-cvs) Which seems to work fine. Regards, -- François Fleuret