aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-07 04:39:30 +0000
committerRichard M. Stallman1994-05-07 04:39:30 +0000
commit08020d91e03971699dacc6be16e73b05b64cd50c (patch)
tree729bb7d1f7d0968ecba66d7bf3636c1cd52c7bed
parent3be1f08e7457f4ca495df76dac34eb19917e7c14 (diff)
downloademacs-08020d91e03971699dacc6be16e73b05b64cd50c.tar.gz
emacs-08020d91e03971699dacc6be16e73b05b64cd50c.zip
entered into RCS
-rw-r--r--lisp/ediff.el77
1 files changed, 28 insertions, 49 deletions
diff --git a/lisp/ediff.el b/lisp/ediff.el
index 4ecd56a2ba6..7f2584f3848 100644
--- a/lisp/ediff.el
+++ b/lisp/ediff.el
@@ -26,8 +26,8 @@
26;;; Commentary: 26;;; Commentary:
27;; ---------- 27;; ----------
28 28
29;; Never read those diff(1) outputs again! 29;; Never read those diff outputs again!
30;; Apply patch(1) selectively, like a pro! 30;; Apply patch selectively, like a pro!
31 31
32;; This package provides a convenient way of simultaneous brousing through 32;; This package provides a convenient way of simultaneous brousing through
33;; the differences between a pair of files or buffers. The two files being 33;; the differences between a pair of files or buffers. The two files being
@@ -52,8 +52,8 @@
52 52
53;; Ediff is complimentary to Emerge. While Emerge is better at heavy-duty 53;; Ediff is complimentary to Emerge. While Emerge is better at heavy-duty
54;; tasks that involve merging of files, Ediff is by far superior 54;; tasks that involve merging of files, Ediff is by far superior
55;; for browsing through files compared via diff(1) and for patching files 55;; for browsing through files compared via diff and for patching files
56;; with patch(1). Furthermore, I feel that Ediff is more convenient for 56;; with patch. Furthermore, I feel that Ediff is more convenient for
57;; merging tasks where one of the files is a designated output. This 57;; merging tasks where one of the files is a designated output. This
58;; situation arises while patching files or when comparing an old version 58;; situation arises while patching files or when comparing an old version
59;; of a file with a newer version (in such cases, it is often desirable to 59;; of a file with a newer version (in such cases, it is often desirable to
@@ -125,7 +125,7 @@
125 125
126;; 1. Ediff is unlikely to run under Emacs 18 without some further work. 126;; 1. Ediff is unlikely to run under Emacs 18 without some further work.
127;; 2. If running Lucid Emacs, Ediff requires at least version 19.9. 127;; 2. If running Lucid Emacs, Ediff requires at least version 19.9.
128;; 3. I didn't test Ediff on FSF versions older than 19.19. 128;; 3. I didn't test Ediff on Emacs versions older than 19.19.
129;; 4. The function vc-ediff requires the vc.el version that comes with 129;; 4. The function vc-ediff requires the vc.el version that comes with
130;; Emacs 19.22. 130;; Emacs 19.22.
131 131
@@ -153,13 +153,13 @@
153;; 153;;
154;; To use Ediff, put this in your .emacs file: 154;; To use Ediff, put this in your .emacs file:
155;; 155;;
156;; (autoload 'ediff-buffers "ediff" "Visual interface to diff(1)" t) 156;; (autoload 'ediff-buffers "ediff" "Visual interface to diff" t)
157;; (autoload 'ediff "ediff" "Visual interface to diff(1)" t) 157;; (autoload 'ediff "ediff" "Visual interface to diff" t)
158;; (autoload 'ediff-files "ediff" "Visual interface to diff(1)" t) 158;; (autoload 'ediff-files "ediff" "Visual interface to diff" t)
159;; (autoload 'ediff-files-remote "ediff" "Visual interface to diff(1)") 159;; (autoload 'ediff-files-remote "ediff" "Visual interface to diff")
160;; (autoload 'epatch "ediff" "Visual interface to patch(1)" t) 160;; (autoload 'epatch "ediff" "Visual interface to patch" t)
161;; (autoload 'ediff-patch-file "ediff" "Visual interface to patch(1)" t) 161;; (autoload 'ediff-patch-file "ediff" "Visual interface to patch" t)
162;; (autoload 'ediff-patch-buffer "ediff" "Visual interface to patch(1)" t) 162;; (autoload 'ediff-patch-buffer "ediff" "Visual interface to patch" t)
163;; (autoload 'vc-ediff "ediff" 163;; (autoload 'vc-ediff "ediff"
164;; "Interface to diff & version control via vc.el" t) 164;; "Interface to diff & version control via vc.el" t)
165;; (autoload 'rcs-ediff "ediff" 165;; (autoload 'rcs-ediff "ediff"
@@ -180,23 +180,6 @@
180;; 180;;
181;; When you byte-compile Ediff, you will get some warnings about functions 181;; When you byte-compile Ediff, you will get some warnings about functions
182;; being undefined. These can be safely ignored. 182;; being undefined. These can be safely ignored.
183;;
184;; Warning:
185;; =======
186;;
187;; If you are using advice.el (directly or indirectly, via one of the
188;; other packages), Ediff may not compile properly. In this case, you
189;; should do:
190;;
191;; M-x ad-deactivate-all RET
192;;
193;; M-x byte-compile-file RET ediff.el RET
194;;
195;; M-x ad-activate-all RET
196;;
197;; This precaution will not be needed starting with GNU Emacs 19.23 and
198;; Lucid Emacs 19.10, due to fixing a bug in advice.el.
199
200 183
201;;; Customization: 184;;; Customization:
202;; ------------- 185;; -------------
@@ -249,11 +232,11 @@
249;; displays, Ediff uses ediff-current-diff-face-A and 232;; displays, Ediff uses ediff-current-diff-face-A and
250;; ediff-current-diff-face-B to highlight the current difference regions. 233;; ediff-current-diff-face-B to highlight the current difference regions.
251;; Other (non-current) difference regions are displayed in alternating 234;; Other (non-current) difference regions are displayed in alternating
252;; faces: ediff-even/odd-diff-face-A/B. (In GNU Emacs, the odd and the even 235;; faces: ediff-even/odd-diff-face-A/B. The odd and the even
253;; faces are actually identical on monochrome displays, because it is 236;; faces are actually identical on monochrome displays, because it is
254;; rather poor in what you can do on such a display. So, I chose to use 237;; rather poor in what you can do on such a display. So, I chose to use
255;; italics to highlight other differences. Any ideas would be welcome. In 238;; italics to highlight other differences. Any ideas would be welcome.
256;; Lucid Emacs, the situation is better because it supports pixmaps.) 239;;
257;; There are two ways to change the default setting for highlighting faces: 240;; There are two ways to change the default setting for highlighting faces:
258;; either change the variables, as in 241;; either change the variables, as in
259;; 242;;
@@ -306,13 +289,13 @@
306;; exception is when you may want to generate differences with context 289;; exception is when you may want to generate differences with context
307;; lines in order to send a patch file through email. Then, you might want 290;; lines in order to send a patch file through email. Then, you might want
308;; to set ediff-diff-options to '-c'. Sometimes, you may also want to tell 291;; to set ediff-diff-options to '-c'. Sometimes, you may also want to tell
309;; diff(1) to ignore spaces and such. Use the option '-w' for that. Diff(1) 292;; diff to ignore spaces and such. Use the option '-w' for that. Diff
310;; has several other useful options (type 'man diff' to find out). 293;; has several other useful options (type 'man diff' to find out).
311;; 294;;
312;; The output from diff(1) is found in *ediff-diff* buffer. However, this 295;; The output from diff is found in *ediff-diff* buffer. However, this
313;; makes sense only if you also intend to use Ediff to browse through the 296;; makes sense only if you also intend to use Ediff to browse through the
314;; diff'ed files before sending the patch. This is because diff.el is much 297;; diff'ed files before sending the patch. This is because diff.el is much
315;; faster in yielding the output of diff(1) ;; (Ediff is a big gun, if used 298;; faster in yielding the output of diff ;; (Ediff is a big gun, if used
316;; for this simple purpose). 299;; for this simple purpose).
317;; 300;;
318;; The last set of variables that can be modified is 301;; The last set of variables that can be modified is
@@ -405,8 +388,7 @@
405;; 1. The undo command doesn't restore deleted regions well. That is, if 388;; 1. The undo command doesn't restore deleted regions well. That is, if
406;; you delete all characters in a difference region and then invoke 389;; you delete all characters in a difference region and then invoke
407;; `undo', the reinserted text will most likely be reinserted outside of 390;; `undo', the reinserted text will most likely be reinserted outside of
408;; what Ediff thinks is the current difference region. This bug seems to 391;; what Ediff thinks is the current difference region.
409;; be present only in GNU Emacs. Lucid Emacs does fine in this respect.
410 392
411;; 2. You may get an error if your colormap doesn't have the colors requested 393;; 2. You may get an error if your colormap doesn't have the colors requested
412;; by Ediff (on a color display). If this happens, you should create your 394;; by Ediff (on a color display). If this happens, you should create your
@@ -571,7 +553,7 @@
571;; Fixed a bug with ediffing narrowed buffers, reported by Kevin 553;; Fixed a bug with ediffing narrowed buffers, reported by Kevin
572;; Broadey <KevinB@bartley.demon.co.uk>. 554;; Broadey <KevinB@bartley.demon.co.uk>.
573;; Made Ediff to work with files that have incomplete last line. 555;; Made Ediff to work with files that have incomplete last line.
574;; Made Ediff execute diff(1) and patch(1) using Bourne Shell, which 556;; Made Ediff execute diff and patch using Bourne Shell, which
575;; should eliminate problems with $prompt that some people had. 557;; should eliminate problems with $prompt that some people had.
576 558
577;; Thu March 24, 1994 559;; Thu March 24, 1994
@@ -706,7 +688,7 @@ wa/wb - save buf A/B A/B - toggle read-only buf A/B ? - toggle help")
706 "* Options to pass to ediff-patch-program.") 688 "* Options to pass to ediff-patch-program.")
707 689
708(defvar ediff-shell "sh" 690(defvar ediff-shell "sh"
709 "* The shell used to run diff(1) and patch(1). If user's .profile or 691 "* The shell used to run diff and patch. If user's .profile or
710.cshrc files are set up correctly, any shell will do. However, some people 692.cshrc files are set up correctly, any shell will do. However, some people
711set $prompt or other things incorrectly, which leads to undesirable output 693set $prompt or other things incorrectly, which leads to undesirable output
712messages. These may cause Ediff to fail. In such a case, set ediff-shell 694messages. These may cause Ediff to fail. In such a case, set ediff-shell
@@ -726,7 +708,7 @@ Lines that do not match are assumed to be error messages.")
726(defvar ediff-patch-buf nil 708(defvar ediff-patch-buf nil
727 "The buffer of the patch file.") 709 "The buffer of the patch file.")
728(defvar ediff-patch-diagnostics nil 710(defvar ediff-patch-diagnostics nil
729 "The buffer where patch(1) would display its diagnostics.") 711 "The buffer where patch would display its diagnostics.")
730 712
731 713
732;; Copying diffs betw buffers. 714;; Copying diffs betw buffers.
@@ -843,10 +825,9 @@ councide. ")
843 "Number of differences found.") 825 "Number of differences found.")
844 826
845(emerge-defvar-local ediff-diff-buffer nil 827(emerge-defvar-local ediff-diff-buffer nil
846 "Buffer containing the output of diff(1), which is used by Ediff to step 828 "Buffer containing the output of diff, used by Ediff to step through files.")
847through files.")
848(emerge-defvar-local ediff-diff-error-buffer nil 829(emerge-defvar-local ediff-diff-error-buffer nil
849 "Buffer containing the output of diff(1) when diff returns errors.") 830 "Buffer containing the output of diff, when diff returns errors.")
850 831
851(emerge-defvar-local ediff-this-buffer-control-sessions nil 832(emerge-defvar-local ediff-this-buffer-control-sessions nil
852 "Keeps the list of ediff-control buffers associated with each buffer A/B 833 "Keeps the list of ediff-control buffers associated with each buffer A/B
@@ -875,7 +856,6 @@ of the current diff.")
875 (fset 'ediff-overlay-start (symbol-function 'extent-start-position)) 856 (fset 'ediff-overlay-start (symbol-function 'extent-start-position))
876 (fset 'ediff-overlay-end (symbol-function 'extent-end-position)) 857 (fset 'ediff-overlay-end (symbol-function 'extent-end-position))
877 (fset 'ediff-overlay-get (symbol-function 'extent-property))) 858 (fset 'ediff-overlay-get (symbol-function 'extent-property)))
878 ;; GNU definitions
879 (fset 'ediff-overlayp (symbol-function 'overlayp)) 859 (fset 'ediff-overlayp (symbol-function 'overlayp))
880 (fset 'ediff-make-overlay (symbol-function 'make-overlay)) 860 (fset 'ediff-make-overlay (symbol-function 'make-overlay))
881 (fset 'ediff-delete-overlay (symbol-function 'delete-overlay)) 861 (fset 'ediff-delete-overlay (symbol-function 'delete-overlay))
@@ -1439,8 +1419,7 @@ Else, read patch file into a new buffer."
1439(defun vc-ediff (rev) 1419(defun vc-ediff (rev)
1440 "Run ediff on version REV of the current buffer in another window. 1420 "Run ediff on version REV of the current buffer in another window.
1441If the current buffer is named `F', the version is named `F.~REV~'. 1421If the current buffer is named `F', the version is named `F.~REV~'.
1442If `F.~REV~' already exists, it is used instead of being re-created. 1422If `F.~REV~' already exists, it is used instead of being re-created."
1443Note: this function will work starting with GNU Emacs 19.22."
1444 (interactive "sVersion to ediff with (default is the latest version): ") 1423 (interactive "sVersion to ediff with (default is the latest version): ")
1445 (or (featurep 'vc) 1424 (or (featurep 'vc)
1446 (if (locate-library "vc") ;; if vc.el is available 1425 (if (locate-library "vc") ;; if vc.el is available
@@ -2920,8 +2899,8 @@ control buffer is in effect in case it is not the current buffer."
2920 ediff-current-diff-overlay-A begin-A end-A-hilit) 2899 ediff-current-diff-overlay-A begin-A end-A-hilit)
2921 (ediff-move-overlay 2900 (ediff-move-overlay
2922 ediff-current-diff-overlay-B begin-B end-B-hilit)) 2901 ediff-current-diff-overlay-B begin-B end-B-hilit))
2923 ;; GNU stuff has a bug, which requires that ediff-move-overlay will 2902 ;; Emacs 19.22 has a bug, which requires that ediff-move-overlay will
2924 ;; have the buffer as a parameter. Will be fixed in 19.23 2903 ;; have the buffer as a parameter. Believed fixed in 19.23.
2925 (ediff-move-overlay ediff-current-diff-overlay-A 2904 (ediff-move-overlay ediff-current-diff-overlay-A
2926 begin-A end-A-hilit ediff-A-buffer) 2905 begin-A end-A-hilit ediff-A-buffer)
2927 (ediff-move-overlay ediff-current-diff-overlay-B 2906 (ediff-move-overlay ediff-current-diff-overlay-B