diff options
| author | Richard M. Stallman | 1992-10-05 21:09:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-10-05 21:09:26 +0000 |
| commit | ad0146295eb52d69959ee4ca0775f935e4525043 (patch) | |
| tree | cade2bffed87b37002228b5eda47a767e270e24f | |
| parent | e9c735fabd6c06c4d3f3bd6c21025fd884dacf87 (diff) | |
| download | emacs-ad0146295eb52d69959ee4ca0775f935e4525043.tar.gz emacs-ad0146295eb52d69959ee4ca0775f935e4525043.zip | |
(vc-steal-lock): Use mail-setup, and do like `mail'.
Supply vc-finish-steal as an action on sending.
(vc-finish-steal): Delete the code to send the message.
| -rw-r--r-- | lisp/vc.el | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index 3e60c19b014..e89c9735116 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> | 5 | ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> |
| 6 | ;; Version: 4.0 | 6 | ;; Version: 4.0 |
| 7 | 7 | ||
| 8 | ;; $Id: vc.el,v 1.9 1992/10/05 05:20:52 roland Exp roland $ | 8 | ;; $Id: vc.el,v 1.10 1992/10/05 05:49:27 roland Exp rms $ |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -359,27 +359,25 @@ level to check it in under." | |||
| 359 | (setq owner (vc-locking-user file))) | 359 | (setq owner (vc-locking-user file))) |
| 360 | (if (not (y-or-n-p (format "Take the lock on %s:%s from %s?" file rev owner))) | 360 | (if (not (y-or-n-p (format "Take the lock on %s:%s from %s?" file rev owner))) |
| 361 | (error "Steal cancelled.")) | 361 | (error "Steal cancelled.")) |
| 362 | (pop-to-buffer (get-buffer-create "*VC-log*")) | 362 | (require 'sendmail) |
| 363 | (vc-log-mode) | 363 | (pop-to-buffer (get-buffer-create "*VC-mail*")) |
| 364 | (narrow-to-region (point-max) (point-max)) | 364 | (setq default-directory (expand-file-name "~/")) |
| 365 | (auto-save-mode auto-save-default) | ||
| 366 | (mail-mode) | ||
| 367 | (erase-buffer) | ||
| 368 | (mail-setup owner (format "%s:%s" file rev) nil nil nil | ||
| 369 | (list (list 'vc-finish-steal file rev))) | ||
| 370 | (goto-char (point-max)) | ||
| 365 | (insert | 371 | (insert |
| 366 | (format "To: %s\n\nI stole the lock on %s:%s, " owner file rev) | 372 | (format "I stole the lock on %s:%s, " file rev) |
| 367 | (current-time-string) | 373 | (current-time-string) |
| 368 | "\n") | 374 | ".\n") |
| 369 | (vc-mode-line file (file-name-nondirectory file)) | 375 | (message "Please explain why you stole the lock. Type C-c C-c when done.")) |
| 370 | (setq vc-log-operation 'vc-finish-steal) | ||
| 371 | (setq vc-log-file file) | ||
| 372 | (setq vc-log-version rev) | ||
| 373 | (message "Please explain why you stole the lock. Type C-c C-c when done.") | ||
| 374 | ) | ||
| 375 | 376 | ||
| 377 | ;; This is called when the notification has been sent. | ||
| 376 | (defun vc-finish-steal (file version) | 378 | (defun vc-finish-steal (file version) |
| 377 | ;; Actually do the lock acquisition; send the former owner a notification | ||
| 378 | (vc-backend-steal file version) | 379 | (vc-backend-steal file version) |
| 379 | (require 'sendmail) ;; (send-mail) isn't on the standard autoload list. | 380 | (vc-resynch-window file t)) |
| 380 | (mail-send) | ||
| 381 | (vc-resynch-window file t) | ||
| 382 | ) | ||
| 383 | 381 | ||
| 384 | (defun vc-checkout (file &optional writeable) | 382 | (defun vc-checkout (file &optional writeable) |
| 385 | "Retrieve a copy of the latest version of the given file." | 383 | "Retrieve a copy of the latest version of the given file." |