summaryrefslogtreecommitdiff
path: root/lisp/vc.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2009-07-23 05:21:34 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2009-07-23 05:21:34 +0000
commitd6a62b0d7a23e494dc8adf06ca34d5b2cfe9c319 (patch)
treea757707653b85905802b0e5288d6b26a8af347f2 /lisp/vc.el
parent291bc6bdf9d75dc1d90a599d84ed45e842d3f1ea (diff)
(vc-print-log-internal): New function, split out from ...
(vc-print-log): ... here.
Diffstat (limited to 'lisp/vc.el')
-rw-r--r--lisp/vc.el52
1 files changed, 30 insertions, 22 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index d063c2c8abc..590787e019c 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -1815,6 +1815,35 @@ allowed and simply skipped)."
;; Miscellaneous other entry points
+(defun vc-print-log-internal (backend files working-revision)
+ ;; Don't switch to the output buffer before running the command,
+ ;; so that any buffer-local settings in the vc-controlled
+ ;; buffer can be accessed by the command.
+ (vc-call-backend backend 'print-log files "*vc-change-log*")
+ (pop-to-buffer "*vc-change-log*")
+ (vc-exec-after
+ `(let ((inhibit-read-only t))
+ (vc-call-backend ',backend 'log-view-mode)
+ (set (make-local-variable 'log-view-vc-backend) ',backend)
+ (set (make-local-variable 'log-view-vc-fileset) ',files)
+
+ ;; FIXME: this seems to apply only to RCS/CVS, it doesn't quite
+ ;; belong here in the generic code.
+ (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))
+ (when (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 working revision
+ (vc-call-backend ',backend 'show-log-entry ',working-revision)
+ (setq vc-sentinel-movepoint (point))
+ (set-buffer-modified-p nil))))
+
;;;###autoload
(defun vc-print-log (&optional working-revision)
"List the change log of the current fileset in a window.
@@ -1824,28 +1853,7 @@ If WORKING-REVISION is non-nil, leave the point at that revision."
(backend (car vc-fileset))
(files (cadr vc-fileset))
(working-revision (or working-revision (vc-working-revision (car files)))))
- ;; Don't switch to the output buffer before running the command,
- ;; so that any buffer-local settings in the vc-controlled
- ;; buffer can be accessed by the command.
- (vc-call-backend backend 'print-log files "*vc-change-log*")
- (pop-to-buffer "*vc-change-log*")
- (vc-exec-after
- `(let ((inhibit-read-only t))
- (vc-call-backend ',backend 'log-view-mode)
- (set (make-local-variable 'log-view-vc-backend) ',backend)
- (set (make-local-variable 'log-view-vc-fileset) ',files)
- (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))
- (when (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 working revision
- (vc-call-backend ',backend 'show-log-entry ',working-revision)
- (setq vc-sentinel-movepoint (point))
- (set-buffer-modified-p nil)))))
+ (vc-print-log-internal backend files working-revision)))
;;;###autoload
(defun vc-revert ()