My work uses GNU RCS for our version control system, but I don't think the specific VCS is relevant here. (I know RCS isn't the most modern system but it suits our needs fine and has the advantage of relative simplicity. Anyway, that's not the question.)
When I steal the lock on a file using C-x v v
, emacs opens up a buffer so I can email the person from whom I stole it. I never need to do this, so I have to go to the trouble of killing the buffer and then confirming that I want to do so. This is a hassle I'd rather avoid.
So, how can I make emacs not open that buffer in the first place?
EDIT As pointed out in the comments, I could have included more relevant info.
The package is vc
, and the keybinding C-x v v
calls the function vc-next-action
, which is a smart command that attempts to figure out what you want to do next.
In this case, RCS is an "old-style locking-based VCS", somebody else has locked the file and the function is attempting to steal the lock, as outlined in the function's documentation.
FURTHER EDIT Digging a little more deeply, it seems that vc-next-action
is calling vc-steal-lock
(surprise, surprise). This function contains the following chunk of code at the end:
;; Write mail after actually stealing, because if the stealing
;; goes wrong, we don't want to send any mail.
(compose-mail owner (format "Stolen lock on %s" file-description))
(setq default-directory (expand-file-name "~/"))
(goto-char (point-max))
(insert
(format "I stole the lock on %s, " file-description)
(current-time-string)
".\n")
(message "Please explain why you stole the lock. Type C-c C-c when done."))
I assume that if I comment this out, the email buffer won't open. I know that just commenting out this chunk in the source code isn't the right way to go about things. But what is the right way to modify a built-in function in a way that will survive if I upgrade, reinstall, etc?
(require 'name-of-library)
and then typeM-x find-function RET name-of-function RET
and follow the trail to see what makes it tick. If we had thename-of-function
andname-of-library
it sure would be a lot easier than figuring out what library has a keyboard shortcut ofC-x v v
relating to RCS/VCS. :)