From ba127bdbfbcd2e47ddfbdfca96b6a750242335c1 Mon Sep 17 00:00:00 2001 From: Jonathan Kamens Date: Sun, 6 Oct 2002 09:34:02 -0800 Subject: [PATCH] Changed vc-print-log slightly to conform to current version of vc.el in Emacs source tree. [git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 2214] --- vc-p4.el | 58 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/vc-p4.el b/vc-p4.el index 184bb0d..d1a0b95 100644 --- a/vc-p4.el +++ b/vc-p4.el @@ -67,33 +67,37 @@ ; We need to fix some functions that are broken in vc.el. -(defun vc-print-log () - "List the change log of the current buffer in a window." - (interactive) - (vc-ensure-vc-buffer) - (let* ((file buffer-file-name) - (use-log-view (memq (vc-backend file) '(CVS RCS SCCS)))) - (vc-call print-log file) - (set-buffer "*vc*") - (pop-to-buffer (current-buffer)) - (if (and use-log-view (fboundp 'log-view-mode)) (log-view-mode)) - (vc-exec-after - `(progn - (goto-char (point-max)) (forward-line -1) - (while (looking-at "=*\n") - (delete-char (- (match-end 0) (match-beginning 0))) - (forward-line -1)) - (goto-char (point-min)) - (if (looking-at "[\b\t\n\v\f\r ]+") - (delete-char (- (match-end 0) (match-beginning 0)))) - (shrink-window-if-larger-than-buffer) - ;; move point to the log entry for the current version - (if (and use-log-view (fboundp 'log-view-goto-rev)) - (log-view-goto-rev ',(vc-workfile-version file)) - (if (vc-find-backend-function ',(vc-backend file) 'show-log-entry) - (vc-call-backend ',(vc-backend file) - 'show-log-entry - ',(vc-workfile-version file)))))))) +(if (fboundp 'vc-default-show-log-entry) + t + + (defun vc-default-show-log-entry (backend ver) + (if (fboundp 'log-view-goto-rev) + (log-view-goto-rev rev))) + + (defun vc-print-log () + "List the change log of the current buffer in a window." + (interactive) + (vc-ensure-vc-buffer) + (let ((file buffer-file-name)) + (vc-call print-log file) + (set-buffer "*vc*") + (pop-to-buffer (current-buffer)) + (log-view-mode) + (vc-exec-after + `(let ((inhibit-read-only t)) + (goto-char (point-max)) (forward-line -1) + (while (looking-at "=*\n") + (delete-char (- (match-end 0) (match-beginning 0))) + (forward-line -1)) + (goto-char (point-min)) + (if (looking-at "[\b\t\n\v\f\r ]+") + (delete-char (- (match-end 0) (match-beginning 0)))) + (shrink-window-if-larger-than-buffer) + ;; move point to the log entry for the current version + (vc-call-backend ',(vc-backend file) + 'show-log-entry + ',(vc-workfile-version file)) + (set-buffer-modified-p nil)))))) (defun vc-register (&optional set-version comment) "Register the current file into a version control system.