Mercurial > emacs
annotate lisp/ediff-vers.el @ 85858:0745c5662909
(nroff-mode): Set indent-line-function.
(nroff-indent-line-function): New function.
(nroff-count-text-lines): Use nroff-forward-text-line rather than
obsolete alias.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 01 Nov 2007 04:00:09 +0000 |
parents | 13163bbed0bf |
children | d505125b0b46 |
rev | line source |
---|---|
14234 | 1 ;;; ediff-vers.el --- version control interface to Ediff |
2 | |
74439 | 3 ;; Copyright (C) 1995, 1996, 1997, 2001, 2002, 2003, 2004, |
75347 | 4 ;; 2005, 2006, 2007 Free Software Foundation, Inc. |
14234 | 5 |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
6 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu> |
14234 | 7 |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
78236
9355f9b7bbff
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
12 ;; the Free Software Foundation; either version 3, or (at your option) |
14234 | 13 ;; any later version. |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64091 | 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 ;; Boston, MA 02110-1301, USA. | |
14234 | 24 |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
35109
diff
changeset
|
25 ;;; Commentary: |
14234 | 26 |
27 ;;; Code: | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14234
diff
changeset
|
28 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14234
diff
changeset
|
29 ;; Compiler pacifier |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14234
diff
changeset
|
30 (defvar rcs-default-co-switches) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14234
diff
changeset
|
31 (defvar sc-mode) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14234
diff
changeset
|
32 (defvar cvs-shell) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14234
diff
changeset
|
33 (defvar cvs-program) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14234
diff
changeset
|
34 (defvar cvs-cookie-handle) |
18054 | 35 (defvar ediff-temp-file-prefix) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14234
diff
changeset
|
36 |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
37 (and noninteractive |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
38 (eval-when-compile |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
39 (let ((load-path (cons (expand-file-name ".") load-path))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
40 (load "pcl-cvs" 'noerror) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
41 (load "rcs" 'noerror) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
42 ;; (load "vc" 'noerror) ; this sometimes causes compiler error |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
43 (or (featurep 'ediff-init) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
44 (load "ediff-init.el" nil nil 'nosuffix)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
45 ))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14234
diff
changeset
|
46 ;; end pacifier |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
47 |
71382
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
48 (defcustom ediff-keep-tmp-versions nil |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
49 "*If t, do not delete temporary previous versions for the files on which |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
50 comparison or merge operations are being performed." |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
51 :type 'boolean |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
52 :group 'ediff-vers |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
53 ) |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
54 |
14234 | 55 ;; VC.el support |
49428
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
56 |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
57 (defun ediff-vc-latest-version (file) |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
58 "Return the version level of the latest version of FILE in repository." |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
59 (if (fboundp 'vc-latest-version) |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
60 (vc-latest-version file) |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
61 (or (vc-file-getprop file 'vc-latest-version) |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
62 (cond ((vc-backend file) |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
63 (vc-call state file) |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
64 (vc-file-getprop file 'vc-latest-version)) |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
65 (t (error "File %s is not under version control" file)))) |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
66 )) |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
67 |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
68 |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
69 (defun ediff-vc-internal (rev1 rev2 &optional startup-hooks) |
49428
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
70 ;; Run Ediff on versions of the current buffer. |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
71 ;; If REV1 is "", use the latest version of the current buffer's file. |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
72 ;; If REV2 is "" then compare current buffer with REV1. |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
73 ;; If the current buffer is named `F', the version is named `F.~REV~'. |
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
74 ;; If `F.~REV~' already exists, it is used instead of being re-created. |
14234 | 75 (let (file1 file2 rev1buf rev2buf) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
76 (if (string= rev1 "") |
49428
0f80cb4f9d29
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
77 (setq rev1 (ediff-vc-latest-version (buffer-file-name)))) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
78 (save-window-excursion |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
79 (save-excursion |
85169
708abc311fa6
Follow through on the VC terminology change (version -> revision).
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85139
diff
changeset
|
80 (vc-revision-other-window rev1) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
81 (setq rev1buf (current-buffer) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
82 file1 (buffer-file-name))) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
83 (save-excursion |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
84 (or (string= rev2 "") ; use current buffer |
85169
708abc311fa6
Follow through on the VC terminology change (version -> revision).
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85139
diff
changeset
|
85 (vc-revision-other-window rev2)) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
86 (setq rev2buf (current-buffer) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
87 file2 (buffer-file-name))) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
88 (setq startup-hooks |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
89 (cons `(lambda () |
71382
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
90 (ediff-delete-version-file ,file1) |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
91 (or ,(string= rev2 "") (ediff-delete-version-file ,file2))) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
92 startup-hooks))) |
14234 | 93 (ediff-buffers |
94 rev1buf rev2buf | |
95 startup-hooks | |
96 'ediff-revision))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
97 |
14234 | 98 ;; RCS.el support |
99 (defun rcs-ediff-view-revision (&optional rev) | |
100 ;; View previous RCS revision of current file. | |
101 ;; With prefix argument, prompts for a revision name. | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
102 (interactive (list (if current-prefix-arg |
14234 | 103 (read-string "Revision: ")))) |
104 (let* ((filename (buffer-file-name (current-buffer))) | |
105 (switches (append '("-p") | |
106 (if rev (list (concat "-r" rev)) nil))) | |
107 (buff (concat (file-name-nondirectory filename) ".~" rev "~"))) | |
108 (message "Working ...") | |
109 (setq filename (expand-file-name filename)) | |
110 (with-output-to-temp-buffer buff | |
33391
f8c8c2d3538e
(rcs-ediff-view-revision): Put temp buffer into
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
111 (ediff-with-current-buffer standard-output |
f8c8c2d3538e
(rcs-ediff-view-revision): Put temp buffer into
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
112 (fundamental-mode)) |
14234 | 113 (let ((output-buffer (ediff-rcs-get-output-buffer filename buff))) |
114 (delete-windows-on output-buffer) | |
115 (save-excursion | |
116 (set-buffer output-buffer) | |
117 (apply 'call-process "co" nil t nil | |
118 ;; -q: quiet (no diagnostics) | |
119 (append switches rcs-default-co-switches | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
120 (list "-q" filename))))) |
14234 | 121 (message "") |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
122 buff))) |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
123 |
14234 | 124 (defun ediff-rcs-get-output-buffer (file name) |
125 ;; Get a buffer for RCS output for FILE, make it writable and clean it up. | |
126 ;; Optional NAME is name to use instead of `*RCS-output*'. | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
127 ;; This is a modified version from rcs.el v1.1. I use it here to make |
14234 | 128 ;; Ediff immune to changes in rcs.el |
129 (let* ((default-major-mode 'fundamental-mode) ; no frills! | |
130 (buf (get-buffer-create name))) | |
131 (save-excursion | |
132 (set-buffer buf) | |
133 (setq buffer-read-only nil | |
134 default-directory (file-name-directory (expand-file-name file))) | |
135 (erase-buffer)) | |
136 buf)) | |
137 | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
138 (defun ediff-rcs-internal (rev1 rev2 &optional startup-hooks) |
14234 | 139 ;; Run Ediff on versions of the current buffer. |
140 ;; If REV2 is "" then use current buffer. | |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
141 (let (rev2buf rev1buf) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
142 (save-window-excursion |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
143 (setq rev2buf (if (string= rev2 "") |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
144 (current-buffer) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
145 (rcs-ediff-view-revision rev2)) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
146 rev1buf (rcs-ediff-view-revision rev1))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
147 |
14234 | 148 ;; rcs.el doesn't create temp version files, so we don't have to delete |
149 ;; anything in startup hooks to ediff-buffers | |
150 (ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision) | |
151 )) | |
152 | |
153 ;;; Merge with Version Control | |
154 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
155 (defun ediff-vc-merge-internal (rev1 rev2 ancestor-rev |
20206 | 156 &optional startup-hooks merge-buffer-file) |
14234 | 157 ;; If ANCESTOR-REV non-nil, merge with ancestor |
158 (let (buf1 buf2 ancestor-buf) | |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
159 (save-window-excursion |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
160 (save-excursion |
85169
708abc311fa6
Follow through on the VC terminology change (version -> revision).
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85139
diff
changeset
|
161 (vc-revision-other-window rev1) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
162 (setq buf1 (current-buffer))) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
163 (save-excursion |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
164 (or (string= rev2 "") |
85169
708abc311fa6
Follow through on the VC terminology change (version -> revision).
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85139
diff
changeset
|
165 (vc-revision-other-window rev2)) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
166 (setq buf2 (current-buffer))) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
167 (if ancestor-rev |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
168 (save-excursion |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
169 (if (string= ancestor-rev "") |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
78236
diff
changeset
|
170 (setq ancestor-rev (vc-working-revision buffer-file-name))) |
85169
708abc311fa6
Follow through on the VC terminology change (version -> revision).
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85139
diff
changeset
|
171 (vc-revision-other-window ancestor-rev) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
172 (setq ancestor-buf (current-buffer)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
173 (setq startup-hooks |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
174 (cons |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49428
diff
changeset
|
175 `(lambda () |
71382
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
176 (ediff-delete-version-file ,(buffer-file-name buf1)) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
177 (or ,(string= rev2 "") |
71382
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
178 (ediff-delete-version-file ,(buffer-file-name buf2))) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
179 (or ,(string= ancestor-rev "") |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
180 ,(not ancestor-rev) |
71382
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
181 (ediff-delete-version-file ,(buffer-file-name ancestor-buf))) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
182 ) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
183 startup-hooks))) |
14234 | 184 (if ancestor-rev |
185 (ediff-merge-buffers-with-ancestor | |
186 buf1 buf2 ancestor-buf | |
20206 | 187 startup-hooks 'ediff-merge-revisions-with-ancestor merge-buffer-file) |
188 (ediff-merge-buffers | |
189 buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file)) | |
14234 | 190 )) |
191 | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
192 (defun ediff-rcs-merge-internal (rev1 rev2 ancestor-rev |
20206 | 193 &optional |
194 startup-hooks merge-buffer-file) | |
14234 | 195 ;; If ANCESTOR-REV non-nil, merge with ancestor |
196 (let (buf1 buf2 ancestor-buf) | |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
197 (save-window-excursion |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
198 (setq buf1 (rcs-ediff-view-revision rev1) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
199 buf2 (if (string= rev2 "") |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
200 (current-buffer) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
201 (rcs-ediff-view-revision rev2)) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
202 ancestor-buf (if ancestor-rev |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
203 (if (string= ancestor-rev "") |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
204 (current-buffer) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
205 (rcs-ediff-view-revision ancestor-rev))))) |
14234 | 206 ;; rcs.el doesn't create temp version files, so we don't have to delete |
207 ;; anything in startup hooks to ediff-buffers | |
208 (if ancestor-rev | |
209 (ediff-merge-buffers-with-ancestor | |
210 buf1 buf2 ancestor-buf | |
20206 | 211 startup-hooks 'ediff-merge-revisions-with-ancestor merge-buffer-file) |
212 (ediff-merge-buffers | |
213 buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file)))) | |
14234 | 214 |
71382
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
215 |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
216 ;; delete version file on exit unless ediff-keep-tmp-versions is true |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
217 (defun ediff-delete-version-file (file) |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
218 (or ediff-keep-tmp-versions (delete-file file))) |
14234 | 219 |
64215
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
220 |
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
221 (provide 'ediff-vers) |
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
222 |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
223 |
14234 | 224 ;;; Local Variables: |
225 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | |
19047 | 226 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) |
227 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) | |
14234 | 228 ;;; End: |
229 | |
52401 | 230 ;;; arch-tag: bbb34f0c-2a90-426a-a77a-c75f479ebbbf |
14234 | 231 ;;; ediff-vers.el ends here |