Mercurial > emacs
comparison lisp/vc.el @ 41556:678f91af978a
(vc-find-version): New function.
(vc-version-other-window): Redefined in terms of the above.
author | André Spiegel <spiegel@gnu.org> |
---|---|
date | Mon, 26 Nov 2001 16:07:50 +0000 |
parents | 0abfca935c80 |
children | cfae9c0a0035 |
comparison
equal
deleted
inserted
replaced
41555:3bd17f9a707f | 41556:678f91af978a |
---|---|
4 | 4 |
5 ;; Author: FSF (see below for full credits) | 5 ;; Author: FSF (see below for full credits) |
6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
7 ;; Keywords: tools | 7 ;; Keywords: tools |
8 | 8 |
9 ;; $Id: vc.el,v 1.320 2001/11/15 10:31:17 spiegel Exp $ | 9 ;; $Id: vc.el,v 1.321 2001/11/23 10:11:29 spiegel Exp $ |
10 | 10 |
11 ;; This file is part of GNU Emacs. | 11 ;; This file is part of GNU Emacs. |
12 | 12 |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | 13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
14 ;; it under the terms of the GNU General Public License as published by | 14 ;; it under the terms of the GNU General Public License as published by |
1906 (interactive "sVersion to visit (default is workfile version): ") | 1906 (interactive "sVersion to visit (default is workfile version): ") |
1907 (vc-ensure-vc-buffer) | 1907 (vc-ensure-vc-buffer) |
1908 (let* ((file buffer-file-name) | 1908 (let* ((file buffer-file-name) |
1909 (version (if (string-equal rev "") | 1909 (version (if (string-equal rev "") |
1910 (vc-workfile-version file) | 1910 (vc-workfile-version file) |
1911 rev)) | 1911 rev))) |
1912 (automatic-backup (vc-version-backup-file-name file version)) | 1912 (switch-to-buffer-other-window (vc-find-version file version)))) |
1913 (manual-backup (vc-version-backup-file-name file version 'manual))) | 1913 |
1914 (defun vc-find-version (file version) | |
1915 "Read VERSION of FILE into a buffer and return the buffer." | |
1916 (let ((automatic-backup (vc-version-backup-file-name file version)) | |
1917 (manual-backup (vc-version-backup-file-name file version 'manual))) | |
1914 (unless (file-exists-p manual-backup) | 1918 (unless (file-exists-p manual-backup) |
1915 (if (file-exists-p automatic-backup) | 1919 (if (file-exists-p automatic-backup) |
1916 (rename-file automatic-backup manual-backup nil) | 1920 (rename-file automatic-backup manual-backup nil) |
1917 (vc-call checkout file nil version manual-backup))) | 1921 (vc-call checkout file nil version manual-backup))) |
1918 (find-file-other-window manual-backup))) | 1922 (find-file-noselect manual-backup))) |
1919 | 1923 |
1920 ;; Header-insertion code | 1924 ;; Header-insertion code |
1921 | 1925 |
1922 ;;;###autoload | 1926 ;;;###autoload |
1923 (defun vc-insert-headers () | 1927 (defun vc-insert-headers () |