comparison lisp/vc.el @ 53679:7a2e7bea75b0

(vc-current-line): Function removed. This is now done by the new function line-at-pos in simple.el. (vc-annotate-warp-version): Use line-at-pos instead of vc-current-line.
author André Spiegel <spiegel@gnu.org>
date Thu, 22 Jan 2004 23:34:33 +0000
parents 34fd515d8bb8
children 97c8dfb8be3d
comparison
equal deleted inserted replaced
53678:39002dae1bb3 53679:7a2e7bea75b0
5 5
6 ;; Author: FSF (see below for full credits) 6 ;; Author: FSF (see below for full credits)
7 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> 7 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
8 ;; Keywords: tools 8 ;; Keywords: tools
9 9
10 ;; $Id: vc.el,v 1.362 2004/01/20 17:39:09 uid65624 Exp $ 10 ;; $Id: vc.el,v 1.363 2004/01/21 11:05:51 uid65624 Exp $
11 11
12 ;; This file is part of GNU Emacs. 12 ;; This file is part of GNU Emacs.
13 13
14 ;; GNU Emacs is free software; you can redistribute it and/or modify 14 ;; GNU Emacs is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by 15 ;; it under the terms of the GNU General Public License as published by
3133 (message "Cannot diff from any version prior to %s" rev-at-line) 3133 (message "Cannot diff from any version prior to %s" rev-at-line)
3134 (save-window-excursion 3134 (save-window-excursion
3135 (vc-version-diff vc-annotate-parent-file prev-rev rev-at-line)) 3135 (vc-version-diff vc-annotate-parent-file prev-rev rev-at-line))
3136 (switch-to-buffer "*vc-diff*")))))) 3136 (switch-to-buffer "*vc-diff*"))))))
3137 3137
3138 (defun vc-current-line ()
3139 "Return the current buffer's line number."
3140 (let ((oldpoint (point)) start)
3141 (save-excursion
3142 (save-restriction
3143 (goto-char (point-min))
3144 (widen)
3145 (forward-line 0)
3146 (setq start (point))
3147 (goto-char oldpoint)
3148 (forward-line 0)
3149 (1+ (count-lines (point-min) (point)))))))
3150
3151 (defun vc-annotate-warp-version (revspec) 3138 (defun vc-annotate-warp-version (revspec)
3152 "Annotate the version described by REVSPEC. 3139 "Annotate the version described by REVSPEC.
3153 3140
3154 If REVSPEC is a positive integer, warp that many versions 3141 If REVSPEC is a positive integer, warp that many versions
3155 forward, if possible, otherwise echo a warning message. If 3142 forward, if possible, otherwise echo a warning message. If
3157 if possible, otherwise echo a warning message. If REVSPEC is a 3144 if possible, otherwise echo a warning message. If REVSPEC is a
3158 string, then it describes a revision number, so warp to that 3145 string, then it describes a revision number, so warp to that
3159 revision." 3146 revision."
3160 (if (not (equal major-mode 'vc-annotate-mode)) 3147 (if (not (equal major-mode 'vc-annotate-mode))
3161 (message "Cannot be invoked outside of a vc annotate buffer") 3148 (message "Cannot be invoked outside of a vc annotate buffer")
3162 (let* ((oldline (vc-current-line)) 3149 (let* ((oldline (line-at-pos))
3163 (revspeccopy revspec) 3150 (revspeccopy revspec)
3164 (newrev nil)) 3151 (newrev nil))
3165 (cond 3152 (cond
3166 ((and (integerp revspec) (> revspec 0)) 3153 ((and (integerp revspec) (> revspec 0))
3167 (setq newrev vc-annotate-parent-rev) 3154 (setq newrev vc-annotate-parent-rev)
3189 (vc-annotate nil newrev vc-annotate-parent-display-mode)) 3176 (vc-annotate nil newrev vc-annotate-parent-display-mode))
3190 (kill-buffer (current-buffer)) ;; kill the buffer we started from 3177 (kill-buffer (current-buffer)) ;; kill the buffer we started from
3191 (switch-to-buffer (car (car (last vc-annotate-buffers)))) 3178 (switch-to-buffer (car (car (last vc-annotate-buffers))))
3192 (goto-line (min oldline (progn (goto-char (point-max)) 3179 (goto-line (min oldline (progn (goto-char (point-max))
3193 (previous-line) 3180 (previous-line)
3194 (vc-current-line)))))))) 3181 (line-at-pos))))))))
3195 3182
3196 (defun vc-annotate-car-last-cons (a-list) 3183 (defun vc-annotate-car-last-cons (a-list)
3197 "Return car of last cons in association list A-LIST." 3184 "Return car of last cons in association list A-LIST."
3198 (if (not (eq nil (cdr a-list))) 3185 (if (not (eq nil (cdr a-list)))
3199 (vc-annotate-car-last-cons (cdr a-list)) 3186 (vc-annotate-car-last-cons (cdr a-list))