-(if (boundp 'vc-post-command-functions)
- ;; Hook into the new VC.
- (add-hook 'vc-post-command-functions
- (lambda (cmd file flags)
- (cvs-vc-command-advice (current-buffer) cmd (car flags))))
- ;; Hook into the old VC.
- (defadvice vc-simple-command (after pcl-cvs-vc activate)
- (cvs-vc-command-advice "*vc-info*" (ad-get-arg 1) (ad-get-arg 3)))
- (defadvice vc-do-command (after pcl-cvs-vc activate)
- (cvs-vc-command-advice (if (eq t (ad-get-arg 0)) (current-buffer)
- (or (ad-get-arg 0) "*vc*"))
- (ad-get-arg 2)
- (if (stringp (ad-get-arg 4))
- (ad-get-arg 4)
- (ad-get-arg 5)))))
-
-(defun cvs-vc-command-advice (buffer command cvscmd)
- (when (and (setq buffer (get-buffer buffer))
- (equal command "cvs")
+(add-hook 'vc-post-command-functions 'cvs-vc-command-advice)
+
+(defun cvs-vc-command-advice (command file flags)
+ (when (and (equal command "cvs")