This is a bizarre problem.
Consider the function vc-register. I can call it
interactively or I can put it in the after-save-hook (just
for testing purposes)
(add-hook (make-local-variable 'after-save-hook) 'vc-register)
And it behaves as expected.
However I have a second function ensure-in-vc-or-check-in,
that function should checkin or register the file, when
called interactively it behaves as expected.
When putting it in the above hook
(add-hook (make-local-variable 'after-save-hook) 'ensure-in-vc-or-check-in)
Then it behaves as expected concerning the checkin but when
it has to register a file the VC-log buffer for the initial
comment is not displayed! It is there but not displayed so
completing the register is cumbersome.
Anybody can explain this to me?
(defun ensure-in-vc-or-check-in ()
"Automatically checkin file ,v can be in the same directory or in the
subdirectory RCS. The idea is to call that function only for files
not for buffers. See the function ensure-in-vc-or-check-in-modes
which could be use in an apropriate HOOK."
(if (or (and (file-exists-p (format "%s,v" (buffer-file-name))))
(and (file-exists-p (format "RCS/%s,v" (file-name-nondirectory
(vc-checkin (buffer-file-name) nil "")
(message "Checked in"))
XEmacs-Beta mailing list