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

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

Re: How to test if a directory is under version control ?


From: François Fleuret
Subject: Re: How to test if a directory is under version control ?
Date: 06 Nov 2003 12:30:59 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

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


reply via email to

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