Mercurial > emacs
comparison lisp/vc-rcs.el @ 47757:93af750650be
(vc-rcs-show-log-entry): Delete.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 04 Oct 2002 18:38:04 +0000 |
parents | 0adc8142b529 |
children | d0555af982c8 |
comparison
equal
deleted
inserted
replaced
47756:b2c9ea334a34 | 47757:93af750650be |
---|---|
3 ;; Copyright (C) 1992,93,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1992,93,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: FSF (see vc.el for full credits) | 5 ;; Author: FSF (see vc.el for full credits) |
6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
7 | 7 |
8 ;; $Id: vc-rcs.el,v 1.25 2002/07/19 13:27:44 spiegel Exp $ | 8 ;; $Id: vc-rcs.el,v 1.26 2002/09/04 20:49:35 spiegel Exp $ |
9 | 9 |
10 ;; This file is part of GNU Emacs. | 10 ;; This file is part of GNU Emacs. |
11 | 11 |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | 12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
13 ;; it under the terms of the GNU General Public License as published by | 13 ;; it under the terms of the GNU General Public License as published by |
489 ;;; | 489 ;;; |
490 | 490 |
491 (defun vc-rcs-print-log (file) | 491 (defun vc-rcs-print-log (file) |
492 "Get change log associated with FILE." | 492 "Get change log associated with FILE." |
493 (vc-do-command nil 0 "rlog" (vc-name file))) | 493 (vc-do-command nil 0 "rlog" (vc-name file))) |
494 | |
495 (defun vc-rcs-show-log-entry (version) | |
496 (when (re-search-forward | |
497 ;; also match some context, for safety | |
498 (concat "----\nrevision " version | |
499 "\\(\tlocked by:.*\n\\|\n\\)date: ") nil t) | |
500 ;; set the display window so that | |
501 ;; the whole log entry is displayed | |
502 (let (start end lines) | |
503 (beginning-of-line) (forward-line -1) (setq start (point)) | |
504 (if (not (re-search-forward "^----*\nrevision" nil t)) | |
505 (setq end (point-max)) | |
506 (beginning-of-line) (forward-line -1) (setq end (point))) | |
507 (setq lines (count-lines start end)) | |
508 (cond | |
509 ;; if the global information and this log entry fit | |
510 ;; into the window, display from the beginning | |
511 ((< (count-lines (point-min) end) (window-height)) | |
512 (goto-char (point-min)) | |
513 (recenter 0) | |
514 (goto-char start)) | |
515 ;; if the whole entry fits into the window, | |
516 ;; display it centered | |
517 ((< (1+ lines) (window-height)) | |
518 (goto-char start) | |
519 (recenter (1- (- (/ (window-height) 2) (/ lines 2))))) | |
520 ;; otherwise (the entry is too large for the window), | |
521 ;; display from the start | |
522 (t | |
523 (goto-char start) | |
524 (recenter 0)))))) | |
525 | 494 |
526 (defun vc-rcs-diff (file &optional oldvers newvers) | 495 (defun vc-rcs-diff (file &optional oldvers newvers) |
527 "Get a difference report using RCS between two versions of FILE." | 496 "Get a difference report using RCS between two versions of FILE." |
528 (if (not oldvers) (setq oldvers (vc-workfile-version file))) | 497 (if (not oldvers) (setq oldvers (vc-workfile-version file))) |
529 (apply 'vc-do-command "*vc-diff*" 1 "rcsdiff" file | 498 (apply 'vc-do-command "*vc-diff*" 1 "rcsdiff" file |