1 ;;; ediff.el --- a comprehensive visual interface to diff & patch
3 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 ;; 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
6 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
7 ;; Created: February 2, 1994
8 ;; Keywords: comparing, merging, patching, tools, unix
10 ;; Yoni Rabkin <yoni@rabkins.net> contacted the maintainer of this
11 ;; file on 20/3/2008, and the maintainer agreed that when a bug is
12 ;; filed in the Emacs bug reporting system against this file, a copy
13 ;; of the bug report be sent to the maintainer's email address.
15 (defconst ediff-version
"2.81.2" "The current version of Ediff")
16 (defconst ediff-date
"April 06, 2008" "Date of last update")
19 ;; This file is part of GNU Emacs.
21 ;; GNU Emacs is free software; you can redistribute it and/or modify
22 ;; it under the terms of the GNU General Public License as published by
23 ;; the Free Software Foundation; either version 3, or (at your option)
26 ;; GNU Emacs is distributed in the hope that it will be useful,
27 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;; GNU General Public License for more details.
31 ;; You should have received a copy of the GNU General Public License
32 ;; along with GNU Emacs; see the file COPYING. If not, write to the
33 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
34 ;; Boston, MA 02110-1301, USA.
38 ;; Never read that diff output again!
39 ;; Apply patch interactively!
42 ;; This package provides a convenient way of simultaneous browsing through
43 ;; the differences between a pair (or a triple) of files or buffers. The
44 ;; files being compared, file-A, file-B, and file-C (if applicable) are
45 ;; shown in separate windows (side by side, one above the another, or in
46 ;; separate frames), and the differences are highlighted as you step
47 ;; through them. You can also copy difference regions from one buffer to
48 ;; another (and recover old differences if you change your mind).
50 ;; Ediff also supports merging operations on files and buffers, including
51 ;; merging using ancestor versions. Both comparison and merging operations can
52 ;; be performed on directories, i.e., by pairwise comparison of files in those
55 ;; In addition, Ediff can apply a patch to a file and then let you step
56 ;; though both files, the patched and the original one, simultaneously,
57 ;; difference-by-difference. You can even apply a patch right out of a
58 ;; mail buffer, i.e., patches received by mail don't even have to be saved.
59 ;; Since Ediff lets you copy differences between buffers, you can, in
60 ;; effect, apply patches selectively (i.e., you can copy a difference
61 ;; region from file_orig to file, thereby undoing any particular patch that
64 ;; Ediff is aware of version control, which lets the user compare
65 ;; files with their older versions. Ediff can also work with remote and
66 ;; compressed files. Details are given below.
68 ;; Finally, Ediff supports directory-level comparison, merging and patching.
69 ;; See the on-line manual for details.
71 ;; This package builds upon the ideas borrowed from emerge.el and several
72 ;; Ediff's functions are adaptations from emerge.el. Much of the functionality
73 ;; Ediff provides is also influenced by emerge.el.
75 ;; The present version of Ediff supersedes Emerge. It provides a superior user
76 ;; interface and has numerous major features not found in Emerge. In
77 ;; particular, it can do patching, and 2-way and 3-way file comparison,
78 ;; merging, and directory operations.
84 ;; 1. The undo command doesn't restore deleted regions well. That is, if
85 ;; you delete all characters in a difference region and then invoke
86 ;; `undo', the reinstated text will most likely be inserted outside of
87 ;; what Ediff thinks is the current difference region. (This problem
88 ;; doesn't seem to exist with XEmacs.)
90 ;; If at any point you feel that difference regions are no longer correct,
91 ;; you can hit '!' to recompute the differences.
93 ;; 2. On a monochrome display, the repertoire of faces with which to
94 ;; highlight fine differences is limited. By default, Ediff is using
95 ;; underlining. However, if the region is already underlined by some other
96 ;; overlays, there is no simple way to temporarily remove that residual
97 ;; underlining. This problem occurs when a buffer is highlighted with
98 ;; hilit19.el or font-lock.el packages. If this residual highlighting gets
99 ;; in the way, you can do the following. Both font-lock.el and hilit19.el
100 ;; provide commands for unhighlighting buffers. You can either place these
101 ;; commands in `ediff-prepare-buffer-hook' (which will unhighlight every
102 ;; buffer used by Ediff) or you can execute them interactively, at any time
103 ;; and on any buffer.
106 ;;; Acknowledgements:
108 ;; Ediff was inspired by Dale R. Worley's <drw@math.mit.edu> emerge.el.
109 ;; Ediff would not have been possible without the help and encouragement of
110 ;; its many users. See Ediff on-line Info for the full list of those who
111 ;; helped. Improved defaults in Ediff file-name reading commands.
119 (unless (fboundp 'declare-function
) (defmacro declare-function
(&rest r
))))
124 (require 'ediff-util
)
125 (require 'ediff-ptch
))
128 (require 'ediff-init
)
129 (require 'ediff-mult
) ; required because of the registry stuff
132 "A comprehensive visual interface to diff & patch."
137 (defcustom ediff-use-last-dir nil
138 "*If t, Ediff will use previous directory as default when reading file name."
142 ;; Last directory used by an Ediff command for file-A.
143 (defvar ediff-last-dir-A nil
)
144 ;; Last directory used by an Ediff command for file-B.
145 (defvar ediff-last-dir-B nil
)
146 ;; Last directory used by an Ediff command for file-C.
147 (defvar ediff-last-dir-C nil
)
148 ;; Last directory used by an Ediff command for the ancestor file.
149 (defvar ediff-last-dir-ancestor nil
)
150 ;; Last directory used by an Ediff command as the output directory for merge.
151 (defvar ediff-last-merge-autostore-dir nil
)
154 ;; Used as a startup hook to set `_orig' patch file read-only.
155 (defun ediff-set-read-only-in-buf-A ()
156 (ediff-with-current-buffer ediff-buffer-A
157 (toggle-read-only 1)))
159 ;; Return a plausible default for ediff's first file:
160 ;; In dired, return the file number FILENO (or 0) in the list
161 ;; (all-selected-files, filename under the cursor), where directories are
162 ;; ignored. Otherwise, return DEFAULT file name, if non-nil. Else,
163 ;; if the buffer is visiting a file, return that file name.
164 (defun ediff-get-default-file-name (&optional default fileno
)
165 (cond ((eq major-mode
'dired-mode
)
166 (let ((current (dired-get-filename nil
'no-error
))
167 (marked (condition-case nil
168 (dired-get-marked-files 'no-dir
)
170 aux-list choices result
)
171 (or (integerp fileno
) (setq fileno
0))
172 (if (stringp default
)
173 (setq aux-list
(cons default aux-list
)))
174 (if (and (stringp current
) (not (file-directory-p current
)))
175 (setq aux-list
(cons current aux-list
)))
176 (setq choices
(nconc marked aux-list
))
177 (setq result
(elt choices fileno
))
180 ((stringp default
) default
)
181 ((buffer-file-name (current-buffer))
182 (file-name-nondirectory (buffer-file-name (current-buffer))))
185 ;;; Compare files/buffers
188 (defun ediff-files (file-A file-B
&optional startup-hooks
)
189 "Run Ediff on a pair of files, FILE-A and FILE-B."
191 (let ((dir-A (if ediff-use-last-dir
195 (list (setq f
(ediff-read-file-name
198 (ediff-get-default-file-name)
200 (ediff-read-file-name "File B to compare"
202 (if ediff-use-last-dir
204 (file-name-directory f
)))
206 (ediff-add-to-history
208 (ediff-abbreviate-file-name
210 (file-name-nondirectory f
)
212 (ediff-get-default-file-name f
1)))
214 (ediff-files-internal file-A
215 (if (file-directory-p file-B
)
217 (file-name-nondirectory file-A
) file-B
)
224 (defun ediff-files3 (file-A file-B file-C
&optional startup-hooks
)
225 "Run Ediff on three files, FILE-A, FILE-B, and FILE-C."
227 (let ((dir-A (if ediff-use-last-dir
231 (list (setq f
(ediff-read-file-name
234 (ediff-get-default-file-name)
236 (setq ff
(ediff-read-file-name "File B to compare"
238 (if ediff-use-last-dir
240 (file-name-directory f
)))
242 (ediff-add-to-history
244 (ediff-abbreviate-file-name
246 (file-name-nondirectory f
)
248 (ediff-get-default-file-name f
1))))
249 (ediff-read-file-name "File C to compare"
250 (setq dir-C
(if ediff-use-last-dir
252 (file-name-directory ff
)))
254 (ediff-add-to-history
256 (ediff-abbreviate-file-name
258 (file-name-nondirectory ff
)
260 (ediff-get-default-file-name ff
2)))
262 (ediff-files-internal file-A
263 (if (file-directory-p file-B
)
265 (file-name-nondirectory file-A
) file-B
)
267 (if (file-directory-p file-C
)
269 (file-name-nondirectory file-A
) file-C
)
275 (defalias 'ediff3
'ediff-files3
)
278 ;; Visit FILE and arrange its buffer to Ediff's liking.
279 ;; FILE is actually a variable symbol that must contain a true file name.
280 ;; BUFFER-NAME is a variable symbol, which will get the buffer object into
281 ;; which FILE is read.
282 ;; LAST-DIR is the directory variable symbol where FILE's
283 ;; directory name should be returned. HOOKS-VAR is a variable symbol that will
284 ;; be assigned the hook to be executed after `ediff-startup' is finished.
285 ;; `ediff-find-file' arranges that the temp files it might create will be
287 (defun ediff-find-file (file-var buffer-name
&optional last-dir hooks-var
)
288 (let* ((file (symbol-value file-var
))
289 (file-magic (ediff-filename-magic-p file
))
290 (temp-file-name-prefix (file-name-nondirectory file
)))
291 (cond ((not (file-readable-p file
))
292 (error "File `%s' does not exist or is not readable" file
))
293 ((file-directory-p file
)
294 (error "File `%s' is a directory" file
)))
296 ;; some of the commands, below, require full file name
297 (setq file
(expand-file-name file
))
299 ;; Record the directory of the file
301 (set last-dir
(expand-file-name (file-name-directory file
))))
304 (set buffer-name
(find-file-noselect file
))
306 (ediff-with-current-buffer (symbol-value buffer-name
)
307 (widen) ; Make sure the entire file is seen
308 (cond (file-magic ; file has a handler, such as jka-compr-handler or
309 ;;; ange-ftp-hook-function--arrange for temp file
310 (ediff-verify-file-buffer 'magic
)
312 (ediff-make-temp-file
313 (current-buffer) temp-file-name-prefix
))
314 (set hooks-var
(cons `(lambda () (delete-file ,file
))
315 (symbol-value hooks-var
))))
316 ;; file processed via auto-mode-alist, a la uncompress.el
317 ((not (equal (file-truename file
)
318 (file-truename (buffer-file-name))))
320 (ediff-make-temp-file
321 (current-buffer) temp-file-name-prefix
))
322 (set hooks-var
(cons `(lambda () (delete-file ,file
))
323 (symbol-value hooks-var
))))
324 (t ;; plain file---just check that the file matches the buffer
325 (ediff-verify-file-buffer))))
326 (set file-var file
)))
328 ;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
329 (defun ediff-files-internal (file-A file-B file-C startup-hooks job-name
330 &optional merge-buffer-file
)
331 (let (buf-A buf-B buf-C
)
332 (if (string= file-A file-B
)
333 (error "Files A and B are the same"))
335 (or (and (string= file-A file-C
) (error "Files A and C are the same"))
336 (and (string= file-B file-C
) (error "Files B and C are the same"))))
337 (message "Reading file %s ... " file-A
)
339 (ediff-find-file 'file-A
'buf-A
'ediff-last-dir-A
'startup-hooks
)
340 (message "Reading file %s ... " file-B
)
342 (ediff-find-file 'file-B
'buf-B
'ediff-last-dir-B
'startup-hooks
)
345 (message "Reading file %s ... " file-C
)
349 (if (eq job-name
'ediff-merge-files-with-ancestor
)
350 'ediff-last-dir-ancestor
'ediff-last-dir-C
)
352 (ediff-setup buf-A file-A
356 (list (cons 'ediff-job-name job-name
))
359 (declare-function diff-latest-backup-file
"diff" (fn))
362 (defalias 'ediff
'ediff-files
)
365 (defun ediff-backup (file)
366 "Run Ediff on FILE and its backup file.
367 Uses the latest backup, if there are several numerical backups.
368 If this file is a backup, `ediff' it with its original."
369 (interactive (list (read-file-name "Ediff (file with backup): ")))
370 ;; The code is taken from `diff-backup'.
373 (if (backup-file-name-p file
)
375 ori
(file-name-sans-versions file
))
376 (setq bak
(or (diff-latest-backup-file file
)
377 (error "No backup found for %s" file
))
379 (ediff-files bak ori
)))
382 (defun ediff-buffers (buffer-A buffer-B
&optional startup-hooks job-name
)
383 "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B."
386 (list (setq bf
(read-buffer "Buffer A to compare: "
387 (ediff-other-buffer "") t
))
388 (read-buffer "Buffer B to compare: "
390 ;; realign buffers so that two visible bufs will be
392 (save-window-excursion (other-window 1))
393 (ediff-other-buffer bf
))
395 (or job-name
(setq job-name
'ediff-buffers
))
396 (ediff-buffers-internal buffer-A buffer-B nil startup-hooks job-name
))
399 (defalias 'ebuffers
'ediff-buffers
)
403 (defun ediff-buffers3 (buffer-A buffer-B buffer-C
404 &optional startup-hooks job-name
)
405 "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C."
408 (list (setq bf
(read-buffer "Buffer A to compare: "
409 (ediff-other-buffer "") t
))
410 (setq bff
(read-buffer "Buffer B to compare: "
412 ;; realign buffers so that two visible
413 ;; bufs will be at the top
414 (save-window-excursion (other-window 1))
415 (ediff-other-buffer bf
))
417 (read-buffer "Buffer C to compare: "
419 ;; realign buffers so that three visible
420 ;; bufs will be at the top
421 (save-window-excursion (other-window 1))
422 (ediff-other-buffer (list bf bff
)))
425 (or job-name
(setq job-name
'ediff-buffers3
))
426 (ediff-buffers-internal buffer-A buffer-B buffer-C startup-hooks job-name
))
429 (defalias 'ebuffers3
'ediff-buffers3
)
433 ;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
434 (defun ediff-buffers-internal (buf-A buf-B buf-C startup-hooks job-name
435 &optional merge-buffer-file
)
436 (let* ((buf-A-file-name (buffer-file-name (get-buffer buf-A
)))
437 (buf-B-file-name (buffer-file-name (get-buffer buf-B
)))
438 (buf-C-is-alive (ediff-buffer-live-p buf-C
))
439 (buf-C-file-name (if buf-C-is-alive
440 (buffer-file-name (get-buffer buf-B
))))
441 file-A file-B file-C
)
442 (if (not (ediff-buffer-live-p buf-A
))
443 (error "Buffer %S doesn't exist" buf-A
))
444 (if (not (ediff-buffer-live-p buf-B
))
445 (error "Buffer %S doesn't exist" buf-B
))
446 (let ((ediff-job-name job-name
))
447 (if (and ediff-3way-comparison-job
448 (not buf-C-is-alive
))
449 (error "Buffer %S doesn't exist" buf-C
)))
450 (if (stringp buf-A-file-name
)
451 (setq buf-A-file-name
(file-name-nondirectory buf-A-file-name
)))
452 (if (stringp buf-B-file-name
)
453 (setq buf-B-file-name
(file-name-nondirectory buf-B-file-name
)))
454 (if (stringp buf-C-file-name
)
455 (setq buf-C-file-name
(file-name-nondirectory buf-C-file-name
)))
457 (setq file-A
(ediff-make-temp-file buf-A buf-A-file-name
)
458 file-B
(ediff-make-temp-file buf-B buf-B-file-name
))
460 (setq file-C
(ediff-make-temp-file buf-C buf-C-file-name
)))
462 (ediff-setup (get-buffer buf-A
) file-A
463 (get-buffer buf-B
) file-B
464 (if buf-C-is-alive
(get-buffer buf-C
))
467 (delete-file ,file-A
)
468 (delete-file ,file-B
)
469 (if (stringp ,file-C
) (delete-file ,file-C
)))
471 (list (cons 'ediff-job-name job-name
))
475 ;;; Directory and file group operations
477 ;; Get appropriate default name for directory:
478 ;; If ediff-use-last-dir, use ediff-last-dir-A.
479 ;; In dired mode, use the directory that is under the point (if any);
480 ;; otherwise, use default-directory
481 (defun ediff-get-default-directory-name ()
482 (cond (ediff-use-last-dir ediff-last-dir-A
)
483 ((eq major-mode
'dired-mode
)
484 (let ((f (dired-get-filename nil
'noerror
)))
485 (if (and (stringp f
) (file-directory-p f
))
488 (t default-directory
)))
492 (defun ediff-directories (dir1 dir2 regexp
)
493 "Run Ediff on a pair of directories, DIR1 and DIR2, comparing files that have
494 the same name in both. The third argument, REGEXP, is nil or a regular
495 expression; only file names that match the regexp are considered."
497 (let ((dir-A (ediff-get-default-directory-name))
498 (default-regexp (eval ediff-default-filtering-regexp
))
500 (list (setq f
(read-directory-name
501 "Directory A to compare:" dir-A nil
'must-match
))
502 (read-directory-name "Directory B to compare:"
503 (if ediff-use-last-dir
505 (ediff-strip-last-dir f
))
508 (if (stringp default-regexp
)
509 (format "Filter through regular expression (default %s): "
511 "Filter through regular expression: ")
513 'ediff-filtering-regexp-history
514 (eval ediff-default-filtering-regexp
))
516 (ediff-directories-internal
517 dir1 dir2 nil regexp
'ediff-files
'ediff-directories
521 (defalias 'edirs
'ediff-directories
)
525 (defun ediff-directory-revisions (dir1 regexp
)
526 "Run Ediff on a directory, DIR1, comparing its files with their revisions.
527 The second argument, REGEXP, is a regular expression that filters the file
528 names. Only the files that are under revision control are taken into account."
530 (let ((dir-A (ediff-get-default-directory-name))
531 (default-regexp (eval ediff-default-filtering-regexp
))
533 (list (read-directory-name
534 "Directory to compare with revision:" dir-A nil
'must-match
)
536 (if (stringp default-regexp
)
537 (format "Filter through regular expression (default %s): "
539 "Filter through regular expression: ")
541 'ediff-filtering-regexp-history
542 (eval ediff-default-filtering-regexp
))
544 (ediff-directory-revisions-internal
545 dir1 regexp
'ediff-revision
'ediff-directory-revisions
549 (defalias 'edir-revisions
'ediff-directory-revisions
)
553 (defun ediff-directories3 (dir1 dir2 dir3 regexp
)
554 "Run Ediff on three directories, DIR1, DIR2, and DIR3, comparing files that
555 have the same name in all three. The last argument, REGEXP, is nil or a
556 regular expression; only file names that match the regexp are considered."
559 (let ((dir-A (ediff-get-default-directory-name))
560 (default-regexp (eval ediff-default-filtering-regexp
))
562 (list (setq f
(read-directory-name "Directory A to compare:" dir-A nil
))
563 (setq f
(read-directory-name "Directory B to compare:"
564 (if ediff-use-last-dir
566 (ediff-strip-last-dir f
))
568 (read-directory-name "Directory C to compare:"
569 (if ediff-use-last-dir
571 (ediff-strip-last-dir f
))
574 (if (stringp default-regexp
)
575 (format "Filter through regular expression (default %s): "
577 "Filter through regular expression: ")
579 'ediff-filtering-regexp-history
580 (eval ediff-default-filtering-regexp
))
582 (ediff-directories-internal
583 dir1 dir2 dir3 regexp
'ediff-files3
'ediff-directories3
587 (defalias 'edirs3
'ediff-directories3
)
590 (defun ediff-merge-directories (dir1 dir2 regexp
&optional merge-autostore-dir
)
591 "Run Ediff on a pair of directories, DIR1 and DIR2, merging files that have
592 the same name in both. The third argument, REGEXP, is nil or a regular
593 expression; only file names that match the regexp are considered."
595 (let ((dir-A (ediff-get-default-directory-name))
596 (default-regexp (eval ediff-default-filtering-regexp
))
598 (list (setq f
(read-directory-name "Directory A to merge:"
599 dir-A nil
'must-match
))
600 (read-directory-name "Directory B to merge:"
601 (if ediff-use-last-dir
603 (ediff-strip-last-dir f
))
606 (if (stringp default-regexp
)
607 (format "Filter through regular expression (default %s): "
609 "Filter through regular expression: ")
611 'ediff-filtering-regexp-history
612 (eval ediff-default-filtering-regexp
))
614 (ediff-directories-internal
615 dir1 dir2 nil regexp
'ediff-merge-files
'ediff-merge-directories
616 nil merge-autostore-dir
620 (defalias 'edirs-merge
'ediff-merge-directories
)
623 (defun ediff-merge-directories-with-ancestor (dir1 dir2 ancestor-dir regexp
626 "Merge files in directories DIR1 and DIR2 using files in ANCESTOR-DIR as ancestors.
627 Ediff merges files that have identical names in DIR1, DIR2. If a pair of files
628 in DIR1 and DIR2 doesn't have an ancestor in ANCESTOR-DIR, Ediff will merge
629 without ancestor. The fourth argument, REGEXP, is nil or a regular expression;
630 only file names that match the regexp are considered."
632 (let ((dir-A (ediff-get-default-directory-name))
633 (default-regexp (eval ediff-default-filtering-regexp
))
635 (list (setq f
(read-directory-name "Directory A to merge:" dir-A nil
))
636 (setq f
(read-directory-name "Directory B to merge:"
637 (if ediff-use-last-dir
639 (ediff-strip-last-dir f
))
641 (read-directory-name "Ancestor directory:"
642 (if ediff-use-last-dir
644 (ediff-strip-last-dir f
))
647 (if (stringp default-regexp
)
648 (format "Filter through regular expression (default %s): "
650 "Filter through regular expression: ")
652 'ediff-filtering-regexp-history
653 (eval ediff-default-filtering-regexp
))
655 (ediff-directories-internal
656 dir1 dir2 ancestor-dir regexp
657 'ediff-merge-files-with-ancestor
'ediff-merge-directories-with-ancestor
658 nil merge-autostore-dir
662 (defun ediff-merge-directory-revisions (dir1 regexp
663 &optional merge-autostore-dir
)
664 "Run Ediff on a directory, DIR1, merging its files with their revisions.
665 The second argument, REGEXP, is a regular expression that filters the file
666 names. Only the files that are under revision control are taken into account."
668 (let ((dir-A (ediff-get-default-directory-name))
669 (default-regexp (eval ediff-default-filtering-regexp
))
671 (list (read-directory-name
672 "Directory to merge with revisions:" dir-A nil
'must-match
)
674 (if (stringp default-regexp
)
675 (format "Filter through regular expression (default %s): "
677 "Filter through regular expression: ")
679 'ediff-filtering-regexp-history
680 (eval ediff-default-filtering-regexp
))
682 (ediff-directory-revisions-internal
683 dir1 regexp
'ediff-merge-revisions
'ediff-merge-directory-revisions
684 nil merge-autostore-dir
688 (defalias 'edir-merge-revisions
'ediff-merge-directory-revisions
)
691 (defun ediff-merge-directory-revisions-with-ancestor (dir1 regexp
694 "Run Ediff on a directory, DIR1, merging its files with their revisions and ancestors.
695 The second argument, REGEXP, is a regular expression that filters the file
696 names. Only the files that are under revision control are taken into account."
698 (let ((dir-A (ediff-get-default-directory-name))
699 (default-regexp (eval ediff-default-filtering-regexp
))
701 (list (read-directory-name
702 "Directory to merge with revisions and ancestors:"
703 dir-A nil
'must-match
)
705 (if (stringp default-regexp
)
706 (format "Filter through regular expression (default %s): "
708 "Filter through regular expression: ")
710 'ediff-filtering-regexp-history
711 (eval ediff-default-filtering-regexp
))
713 (ediff-directory-revisions-internal
714 dir1 regexp
'ediff-merge-revisions-with-ancestor
715 'ediff-merge-directory-revisions-with-ancestor
716 nil merge-autostore-dir
721 'edir-merge-revisions-with-ancestor
722 'ediff-merge-directory-revisions-with-ancestor
)
725 (defalias 'edirs-merge-with-ancestor
'ediff-merge-directories-with-ancestor
)
727 ;; Run ediff-action (ediff-files, ediff-merge, ediff-merge-with-ancestors)
728 ;; on a pair of directories (three directories, in case of ancestor).
729 ;; The third argument, REGEXP, is nil or a regular expression;
730 ;; only file names that match the regexp are considered.
731 ;; JOBNAME is the symbol indicating the meta-job to be performed.
732 ;; MERGE-AUTOSTORE-DIR is the directory in which to store merged files.
733 (defun ediff-directories-internal (dir1 dir2 dir3 regexp action jobname
734 &optional startup-hooks
737 (setq dir3
(if (file-directory-p dir3
) dir3
(file-name-directory dir3
))))
739 (cond ((string= dir1 dir2
)
740 (error "Directories A and B are the same: %s" dir1
))
741 ((and (eq jobname
'ediff-directories3
)
743 (error "Directories A and C are the same: %s" dir1
))
744 ((and (eq jobname
'ediff-directories3
)
746 (error "Directories B and C are the same: %s" dir1
)))
748 (if merge-autostore-dir
749 (or (stringp merge-autostore-dir
)
750 (error "%s: Directory for storing merged files must be a string"
752 (let (;; dir-diff-struct is of the form (common-list diff-list)
753 ;; It is a structure where ediff-intersect-directories returns
754 ;; commonalities and differences among directories
757 (if (and ediff-autostore-merges
758 (ediff-merge-metajob jobname
)
759 (not merge-autostore-dir
))
760 (setq merge-autostore-dir
761 (read-directory-name "Save merged files in directory: "
762 (if ediff-use-last-dir
763 ediff-last-merge-autostore-dir
764 (ediff-strip-last-dir dir1
))
767 ;; verify we are not merging into an orig directory
768 (if merge-autostore-dir
769 (cond ((and (stringp dir1
) (string= merge-autostore-dir dir1
))
771 "Directory for saving merged files = Directory A. Sure? ")
772 (error "Directory merge aborted")))
773 ((and (stringp dir2
) (string= merge-autostore-dir dir2
))
775 "Directory for saving merged files = Directory B. Sure? ")
776 (error "Directory merge aborted")))
777 ((and (stringp dir3
) (string= merge-autostore-dir dir3
))
779 "Directory for saving merged files = Ancestor Directory. Sure? ")
780 (error "Directory merge aborted")))))
782 (setq dir-diff-struct
(ediff-intersect-directories
784 regexp dir1 dir2 dir3 merge-autostore-dir
))
786 ;; this sets various vars in the meta buffer inside
787 ;; ediff-prepare-meta-buffer
789 ;; tell what to do if the user clicks on a session record
790 (setq ediff-session-action-function
(quote ,action
))
791 ;; set ediff-dir-difference-list
792 (setq ediff-dir-difference-list
793 (cdr (quote ,dir-diff-struct
))))
795 (setq meta-buf
(ediff-prepare-meta-buffer
796 'ediff-filegroup-action
797 (car dir-diff-struct
)
798 "*Ediff Session Group Panel"
799 'ediff-redraw-directory-group-buffer
802 (ediff-show-meta-buffer meta-buf
)
805 ;; MERGE-AUTOSTORE-DIR can be given to tell ediff where to store the merged
807 (defun ediff-directory-revisions-internal (dir1 regexp action jobname
808 &optional startup-hooks
810 (setq dir1
(if (file-directory-p dir1
) dir1
(file-name-directory dir1
)))
812 (if merge-autostore-dir
813 (or (stringp merge-autostore-dir
)
814 (error "%S: Directory for storing merged files must be a string"
816 (let (file-list meta-buf
)
817 (if (and ediff-autostore-merges
818 (ediff-merge-metajob jobname
)
819 (not merge-autostore-dir
))
820 (setq merge-autostore-dir
821 (read-directory-name "Save merged files in directory: "
822 (if ediff-use-last-dir
823 ediff-last-merge-autostore-dir
824 (ediff-strip-last-dir dir1
))
827 ;; verify merge-autostore-dir != dir1
828 (if (and merge-autostore-dir
830 (string= merge-autostore-dir dir1
))
832 "Directory for saving merged file = directory A. Sure? ")
833 (error "Merge of directory revisions aborted")))
836 (ediff-get-directory-files-under-revision
837 jobname regexp dir1 merge-autostore-dir
))
839 ;; this sets various vars in the meta buffer inside
840 ;; ediff-prepare-meta-buffer
842 ;; tell what to do if the user clicks on a session record
843 (setq ediff-session-action-function
(quote ,action
)))
845 (setq meta-buf
(ediff-prepare-meta-buffer
846 'ediff-filegroup-action
848 "*Ediff Session Group Panel"
849 'ediff-redraw-directory-group-buffer
852 (ediff-show-meta-buffer meta-buf
)
856 ;;; Compare regions and windows
859 (defun ediff-windows-wordwise (dumb-mode &optional wind-A wind-B startup-hooks
)
860 "Compare WIND-A and WIND-B, which are selected by clicking, wordwise.
861 With prefix argument, DUMB-MODE, or on a non-windowing display, works as
863 If WIND-A is nil, use selected window.
864 If WIND-B is nil, use window next to WIND-A."
866 (ediff-windows dumb-mode wind-A wind-B
867 startup-hooks
'ediff-windows-wordwise
'word-mode
))
870 (defun ediff-windows-linewise (dumb-mode &optional wind-A wind-B startup-hooks
)
871 "Compare WIND-A and WIND-B, which are selected by clicking, linewise.
872 With prefix argument, DUMB-MODE, or on a non-windowing display, works as
874 If WIND-A is nil, use selected window.
875 If WIND-B is nil, use window next to WIND-A."
877 (ediff-windows dumb-mode wind-A wind-B
878 startup-hooks
'ediff-windows-linewise nil
))
880 ;; Compare WIND-A and WIND-B, which are selected by clicking.
881 ;; With prefix argument, DUMB-MODE, or on a non-windowing display,
883 ;; If WIND-A is nil, use selected window.
884 ;; If WIND-B is nil, use window next to WIND-A.
885 (defun ediff-windows (dumb-mode wind-A wind-B startup-hooks job-name word-mode
)
886 (if (or dumb-mode
(not (ediff-window-display-p)))
887 (setq wind-A
(ediff-get-next-window wind-A nil
)
888 wind-B
(ediff-get-next-window wind-B wind-A
))
889 (setq wind-A
(ediff-get-window-by-clicking wind-A nil
1)
890 wind-B
(ediff-get-window-by-clicking wind-B wind-A
2)))
892 (let ((buffer-A (window-buffer wind-A
))
893 (buffer-B (window-buffer wind-B
))
894 beg-A end-A beg-B end-B
)
897 (save-window-excursion
898 (sit-for 0) ; sync before using window-start/end -- a precaution
899 (select-window wind-A
)
900 (setq beg-A
(window-start)
902 (select-window wind-B
)
903 (setq beg-B
(window-start)
904 end-B
(window-end))))
906 (ediff-clone-buffer-for-window-comparison
907 buffer-A wind-A
"-Window.A-")
909 (ediff-clone-buffer-for-window-comparison
910 buffer-B wind-B
"-Window.B-"))
911 (ediff-regions-internal
912 buffer-A beg-A end-A buffer-B beg-B end-B
913 startup-hooks job-name word-mode nil
)))
917 (defun ediff-regions-wordwise (buffer-A buffer-B
&optional startup-hooks
)
918 "Run Ediff on a pair of regions in specified buffers.
919 Regions \(i.e., point and mark\) can be set in advance or marked interactively.
920 This function is effective only for relatively small regions, up to 200
921 lines. For large regions, use `ediff-regions-linewise'."
924 (list (setq bf
(read-buffer "Region's A buffer: "
925 (ediff-other-buffer "") t
))
926 (read-buffer "Region's B buffer: "
928 ;; realign buffers so that two visible bufs will be
930 (save-window-excursion (other-window 1))
931 (ediff-other-buffer bf
))
933 (if (not (ediff-buffer-live-p buffer-A
))
934 (error "Buffer %S doesn't exist" buffer-A
))
935 (if (not (ediff-buffer-live-p buffer-B
))
936 (error "Buffer %S doesn't exist" buffer-B
))
940 (ediff-clone-buffer-for-region-comparison buffer-A
"-Region.A-"))
942 (ediff-clone-buffer-for-region-comparison buffer-B
"-Region.B-"))
943 reg-A-beg reg-A-end reg-B-beg reg-B-end
)
945 (set-buffer buffer-A
)
946 (setq reg-A-beg
(region-beginning)
947 reg-A-end
(region-end))
948 (set-buffer buffer-B
)
949 (setq reg-B-beg
(region-beginning)
950 reg-B-end
(region-end)))
952 (ediff-regions-internal
953 (get-buffer buffer-A
) reg-A-beg reg-A-end
954 (get-buffer buffer-B
) reg-B-beg reg-B-end
955 startup-hooks
'ediff-regions-wordwise
'word-mode nil
)))
958 (defun ediff-regions-linewise (buffer-A buffer-B
&optional startup-hooks
)
959 "Run Ediff on a pair of regions in specified buffers.
960 Regions \(i.e., point and mark\) can be set in advance or marked interactively.
961 Each region is enlarged to contain full lines.
962 This function is effective for large regions, over 100-200
963 lines. For small regions, use `ediff-regions-wordwise'."
966 (list (setq bf
(read-buffer "Region A's buffer: "
967 (ediff-other-buffer "") t
))
968 (read-buffer "Region B's buffer: "
970 ;; realign buffers so that two visible bufs will be
972 (save-window-excursion (other-window 1))
973 (ediff-other-buffer bf
))
975 (if (not (ediff-buffer-live-p buffer-A
))
976 (error "Buffer %S doesn't exist" buffer-A
))
977 (if (not (ediff-buffer-live-p buffer-B
))
978 (error "Buffer %S doesn't exist" buffer-B
))
981 (ediff-clone-buffer-for-region-comparison buffer-A
"-Region.A-"))
983 (ediff-clone-buffer-for-region-comparison buffer-B
"-Region.B-"))
984 reg-A-beg reg-A-end reg-B-beg reg-B-end
)
986 (set-buffer buffer-A
)
987 (setq reg-A-beg
(region-beginning)
988 reg-A-end
(region-end))
989 ;; enlarge the region to hold full lines
990 (goto-char reg-A-beg
)
992 (setq reg-A-beg
(point))
993 (goto-char reg-A-end
)
995 (or (eobp) (forward-char)) ; include the newline char
996 (setq reg-A-end
(point))
998 (set-buffer buffer-B
)
999 (setq reg-B-beg
(region-beginning)
1000 reg-B-end
(region-end))
1001 ;; enlarge the region to hold full lines
1002 (goto-char reg-B-beg
)
1004 (setq reg-B-beg
(point))
1005 (goto-char reg-B-end
)
1007 (or (eobp) (forward-char)) ; include the newline char
1008 (setq reg-B-end
(point))
1011 (ediff-regions-internal
1012 (get-buffer buffer-A
) reg-A-beg reg-A-end
1013 (get-buffer buffer-B
) reg-B-beg reg-B-end
1014 startup-hooks
'ediff-regions-linewise nil nil
))) ; no word mode
1016 ;; compare region beg-A to end-A of buffer-A
1017 ;; to regions beg-B -- end-B in buffer-B.
1018 (defun ediff-regions-internal (buffer-A beg-A end-A buffer-B beg-B end-B
1019 startup-hooks job-name word-mode
1021 (let ((tmp-buffer (get-buffer-create ediff-tmp-buffer
))
1025 ;; in case beg/end-A/B aren't markers--make them into markers
1026 (ediff-with-current-buffer buffer-A
1027 (setq beg-A
(move-marker (make-marker) beg-A
)
1028 end-A
(move-marker (make-marker) end-A
)))
1029 (ediff-with-current-buffer buffer-B
1030 (setq beg-B
(move-marker (make-marker) beg-B
)
1031 end-B
(move-marker (make-marker) end-B
)))
1035 (ediff-wordify beg-A end-A buffer-A tmp-buffer
)
1036 (ediff-copy-to-buffer beg-A end-A buffer-A tmp-buffer
))
1037 (setq file-A
(ediff-make-temp-file tmp-buffer
"regA"))
1041 (ediff-wordify beg-B end-B buffer-B tmp-buffer
)
1042 (ediff-copy-to-buffer beg-B end-B buffer-B tmp-buffer
))
1043 (setq file-B
(ediff-make-temp-file tmp-buffer
"regB"))
1045 (setq overl-A
(ediff-make-bullet-proof-overlay beg-A end-A buffer-A
))
1046 (setq overl-B
(ediff-make-bullet-proof-overlay beg-B end-B buffer-B
))
1047 (ediff-setup buffer-A file-A
1049 nil nil
; buffer & file C
1051 (delete-file ,file-A
)
1052 (delete-file ,file-B
))
1055 (list (cons 'ediff-word-mode word-mode
)
1056 (cons 'ediff-narrow-bounds
(list overl-A overl-B
))
1057 (cons 'ediff-job-name job-name
))
1062 ;;; Merge files and buffers
1065 (defalias 'ediff-merge
'ediff-merge-files
)
1067 (defsubst ediff-merge-on-startup
()
1069 ;; Can't remember why this is here, but it may cause the automatically merged
1070 ;; buffer to be lost. So, keep the buffer modified.
1071 ;;(ediff-with-current-buffer ediff-buffer-C
1072 ;; (set-buffer-modified-p nil))
1076 (defun ediff-merge-files (file-A file-B
1077 ;; MERGE-BUFFER-FILE is the file to be
1078 ;; associated with the merge buffer
1079 &optional startup-hooks merge-buffer-file
)
1080 "Merge two files without ancestor."
1082 (let ((dir-A (if ediff-use-last-dir
1086 (list (setq f
(ediff-read-file-name
1089 (ediff-get-default-file-name)
1091 (ediff-read-file-name "File B to merge"
1093 (if ediff-use-last-dir
1095 (file-name-directory f
)))
1097 (ediff-add-to-history
1099 (ediff-abbreviate-file-name
1101 (file-name-nondirectory f
)
1103 (ediff-get-default-file-name f
1)))
1105 (setq startup-hooks
(cons 'ediff-merge-on-startup startup-hooks
))
1106 (ediff-files-internal file-A
1107 (if (file-directory-p file-B
)
1109 (file-name-nondirectory file-A
) file-B
)
1117 (defun ediff-merge-files-with-ancestor (file-A file-B file-ancestor
1120 ;; MERGE-BUFFER-FILE is the file
1121 ;; to be associated with the
1124 "Merge two files with ancestor."
1126 (let ((dir-A (if ediff-use-last-dir
1129 dir-B dir-ancestor f ff
)
1130 (list (setq f
(ediff-read-file-name
1133 (ediff-get-default-file-name)
1135 (setq ff
(ediff-read-file-name "File B to merge"
1137 (if ediff-use-last-dir
1139 (file-name-directory f
)))
1141 (ediff-add-to-history
1143 (ediff-abbreviate-file-name
1145 (file-name-nondirectory f
)
1147 (ediff-get-default-file-name f
1))))
1148 (ediff-read-file-name "Ancestor file"
1150 (if ediff-use-last-dir
1151 ediff-last-dir-ancestor
1152 (file-name-directory ff
)))
1154 (ediff-add-to-history
1156 (ediff-abbreviate-file-name
1158 (file-name-nondirectory ff
)
1160 (ediff-get-default-file-name ff
2)))
1162 (setq startup-hooks
(cons 'ediff-merge-on-startup startup-hooks
))
1163 (ediff-files-internal file-A
1164 (if (file-directory-p file-B
)
1166 (file-name-nondirectory file-A
) file-B
)
1170 'ediff-merge-files-with-ancestor
1174 (defalias 'ediff-merge-with-ancestor
'ediff-merge-files-with-ancestor
)
1177 (defun ediff-merge-buffers (buffer-A buffer-B
1179 ;; MERGE-BUFFER-FILE is the file to be
1180 ;; associated with the merge buffer
1181 startup-hooks job-name merge-buffer-file
)
1182 "Merge buffers without ancestor."
1185 (list (setq bf
(read-buffer "Buffer A to merge: "
1186 (ediff-other-buffer "") t
))
1187 (read-buffer "Buffer B to merge: "
1189 ;; realign buffers so that two visible bufs will be
1191 (save-window-excursion (other-window 1))
1192 (ediff-other-buffer bf
))
1195 (setq startup-hooks
(cons 'ediff-merge-on-startup startup-hooks
))
1196 (or job-name
(setq job-name
'ediff-merge-buffers
))
1197 (ediff-buffers-internal
1198 buffer-A buffer-B nil startup-hooks job-name merge-buffer-file
))
1201 (defun ediff-merge-buffers-with-ancestor (buffer-A buffer-B buffer-ancestor
1205 ;; MERGE-BUFFER-FILE is the
1206 ;; file to be associated
1207 ;; with the merge buffer
1209 "Merge buffers with ancestor."
1212 (list (setq bf
(read-buffer "Buffer A to merge: "
1213 (ediff-other-buffer "") t
))
1214 (setq bff
(read-buffer "Buffer B to merge: "
1216 ;; realign buffers so that two visible
1217 ;; bufs will be at the top
1218 (save-window-excursion (other-window 1))
1219 (ediff-other-buffer bf
))
1221 (read-buffer "Ancestor buffer: "
1223 ;; realign buffers so that three visible
1224 ;; bufs will be at the top
1225 (save-window-excursion (other-window 1))
1226 (ediff-other-buffer (list bf bff
)))
1230 (setq startup-hooks
(cons 'ediff-merge-on-startup startup-hooks
))
1231 (or job-name
(setq job-name
'ediff-merge-buffers-with-ancestor
))
1232 (ediff-buffers-internal
1233 buffer-A buffer-B buffer-ancestor startup-hooks job-name merge-buffer-file
))
1237 (defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file
)
1238 ;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
1239 "Run Ediff by merging two revisions of a file.
1240 The file is the optional FILE argument or the file visited by the current
1243 (if (stringp file
) (find-file file
))
1248 "Version 1 to merge (default %s's working version): "
1250 (file-name-nondirectory file
) "current buffer")))
1254 "Version 2 to merge (default %s): "
1256 (file-name-nondirectory file
) "current buffer"))))
1257 (ediff-load-version-control)
1258 ;; ancestor-revision=nil
1260 (intern (format "ediff-%S-merge-internal" ediff-version-control-package
))
1261 rev1 rev2 nil startup-hooks merge-buffer-file
)))
1265 (defun ediff-merge-revisions-with-ancestor (&optional
1267 ;; MERGE-BUFFER-FILE is the file to
1268 ;; be associated with the merge
1271 "Run Ediff by merging two revisions of a file with a common ancestor.
1272 The file is the optional FILE argument or the file visited by the current
1275 (if (stringp file
) (find-file file
))
1276 (let (rev1 rev2 ancestor-rev
)
1280 "Version 1 to merge (default %s's working version): "
1282 (file-name-nondirectory file
) "current buffer")))
1286 "Version 2 to merge (default %s): "
1288 (file-name-nondirectory file
) "current buffer")))
1292 "Ancestor version (default %s's base revision): "
1294 (file-name-nondirectory file
) "current buffer"))))
1295 (ediff-load-version-control)
1297 (intern (format "ediff-%S-merge-internal" ediff-version-control-package
))
1298 rev1 rev2 ancestor-rev startup-hooks merge-buffer-file
)))
1303 (defun ediff-patch-file (&optional arg patch-buf
)
1304 "Run Ediff by patching SOURCE-FILENAME.
1305 If optional PATCH-BUF is given, use the patch in that buffer
1306 and don't ask the user.
1307 If prefix argument, then: if even argument, assume that the patch is in a
1308 buffer. If odd -- assume it is in a file."
1310 (let (source-dir source-file
)
1311 (require 'ediff-ptch
)
1313 (ediff-get-patch-buffer
1314 (if arg
(prefix-numeric-value arg
)) patch-buf
))
1315 (setq source-dir
(cond (ediff-use-last-dir ediff-last-dir-patch
)
1316 ((and (not ediff-patch-default-directory
)
1317 (buffer-file-name patch-buf
))
1318 (file-name-directory
1320 (buffer-file-name patch-buf
))))
1321 (t default-directory
)))
1324 "File to patch (directory, if multifile patch): "
1325 ;; use an explicit initial file
1326 source-dir nil nil
(ediff-get-default-file-name)))
1327 (ediff-dispatch-file-patching-job patch-buf source-file
)))
1330 (defun ediff-patch-buffer (&optional arg patch-buf
)
1331 "Run Ediff by patching the buffer specified at prompt.
1332 Without the optional prefix ARG, asks if the patch is in some buffer and
1333 prompts for the buffer or a file, depending on the answer.
1334 With ARG=1, assumes the patch is in a file and prompts for the file.
1335 With ARG=2, assumes the patch is in a buffer and prompts for the buffer.
1336 PATCH-BUF is an optional argument, which specifies the buffer that contains the
1337 patch. If not given, the user is prompted according to the prefix argument."
1339 (require 'ediff-ptch
)
1341 (ediff-get-patch-buffer
1342 (if arg
(prefix-numeric-value arg
)) patch-buf
))
1343 (ediff-patch-buffer-internal
1346 "Which buffer to patch? "
1347 (ediff-other-buffer patch-buf
))))
1351 (defalias 'epatch
'ediff-patch-file
)
1353 (defalias 'epatch-buffer
'ediff-patch-buffer
)
1358 ;;; Versions Control functions
1361 (defun ediff-revision (&optional file startup-hooks
)
1362 "Run Ediff by comparing versions of a file.
1363 The file is an optional FILE argument or the file entered at the prompt.
1364 Default: the file visited by the current buffer.
1365 Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
1366 ;; if buffer is non-nil, use that buffer instead of the current buffer
1368 (if (not (stringp file
))
1370 (ediff-read-file-name "Compare revisions for file"
1371 (if ediff-use-last-dir
1374 (ediff-get-default-file-name)
1377 (if (and (buffer-modified-p)
1378 (y-or-n-p (format "Buffer %s is modified. Save buffer? "
1380 (save-buffer (current-buffer)))
1384 (format "Revision 1 to compare (default %s's latest revision): "
1385 (file-name-nondirectory file
)))
1388 (format "Revision 2 to compare (default %s's current state): "
1389 (file-name-nondirectory file
))))
1390 (ediff-load-version-control)
1392 (intern (format "ediff-%S-internal" ediff-version-control-package
))
1393 rev1 rev2 startup-hooks
)
1398 (defalias 'erevision
'ediff-revision
)
1401 ;; Test if version control package is loaded and load if not
1402 ;; Is SILENT is non-nil, don't report error if package is not found.
1403 (defun ediff-load-version-control (&optional silent
)
1404 (require 'ediff-vers
)
1405 (or (featurep ediff-version-control-package
)
1406 (if (locate-library (symbol-name ediff-version-control-package
))
1408 (message "") ; kill the message from `locate-library'
1409 (require ediff-version-control-package
))
1411 (error "Version control package %S.el not found. Use vc.el instead"
1412 ediff-version-control-package
)))))
1416 (defun ediff-version ()
1417 "Return string describing the version of Ediff.
1418 When called interactively, displays the version."
1421 (message "%s" (ediff-version))
1422 (format "Ediff %s of %s" ediff-version ediff-date
)))
1424 ;; info is run first, and will autoload info.el.
1425 (declare-function Info-goto-node
"info" (nodename &optional fork
))
1428 (defun ediff-documentation (&optional node
)
1429 "Display Ediff's manual.
1430 With optional NODE, goes to that node."
1432 (let ((ctl-window ediff-control-window
)
1433 (ctl-buf ediff-control-buffer
))
1435 (ediff-skip-unsuitable-frames)
1438 (pop-to-buffer (get-buffer-create "*info*"))
1439 (info (if (featurep 'xemacs
) "ediff.info" "ediff"))
1441 (Info-goto-node node
)
1442 (message "Type `i' to search for a specific topic"))
1443 (raise-frame (selected-frame)))
1445 (with-output-to-temp-buffer ediff-msg-buffer
1446 (ediff-with-current-buffer standard-output
1448 (princ ediff-BAD-INFO
))
1449 (if (window-live-p ctl-window
)
1451 (select-window ctl-window
)
1452 (set-window-buffer ctl-window ctl-buf
)))))))
1455 (dolist (mess '("^Errors in diff output. Diff output is in "
1456 "^Hmm... I don't see an Ediff command around here...$"
1457 "^Undocumented command! Type `G' in Ediff Control Panel to drop a note to the Ediff maintainer$"
1458 ": This command runs in Ediff Control Buffer only!$"
1459 ": Invalid op in ediff-check-version$"
1460 "^ediff-shrink-window-C can be used only for merging jobs$"
1461 "^Lost difference info on these directories$"
1462 "^This command is inapplicable in the present context$"
1463 "^This session group has no parent$"
1464 "^Can't hide active session, $"
1465 "^Ediff: something wrong--no multiple diffs buffer$"
1466 "^Can't make context diff for Session $"
1467 "^The patch buffer wasn't found$"
1469 "^This Ediff session is not part of a session group$"
1470 "^No active Ediff sessions or corrupted session registry$"
1471 "^No session info in this line$"
1472 "^`.*' is not an ordinary file$"
1473 "^Patch appears to have failed$"
1474 "^Recomputation of differences cancelled$"
1475 "^No fine differences in this mode$"
1476 "^Lost connection to ancestor buffer...sorry$"
1477 "^Not merging with ancestor$"
1478 "^Don't know how to toggle read-only in buffer "
1479 "Emacs is not running as a window application$"
1480 "^This command makes sense only when merging with an ancestor$"
1481 "^At end of the difference list$"
1482 "^At beginning of the difference list$"
1483 "^Nothing saved for diff .* in buffer "
1484 "^Buffer is out of sync for file "
1485 "^Buffer out of sync for file "
1486 "^Output from `diff' not found$"
1487 "^You forgot to specify a region in buffer "
1488 "^All right. Make up your mind and come back...$"
1489 "^Current buffer is not visiting any file$"
1490 "^Failed to retrieve revision: $"
1491 "^Can't determine display width.$"
1492 "^File `.*' does not exist or is not readable$"
1493 "^File `.*' is a directory$"
1494 "^Buffer .* doesn't exist$"
1495 "^Directories . and . are the same: "
1496 "^Directory merge aborted$"
1497 "^Merge of directory revisions aborted$"
1498 "^Buffer .* doesn't exist$"
1499 "^There is no file to merge$"
1500 "^Version control package .*.el not found. Use vc.el instead$"))
1501 (add-to-list 'debug-ignored-errors mess
))
1504 (require 'ediff-util
)
1506 (run-hooks 'ediff-load-hook
)
1509 ;;; Local Variables:
1510 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
1511 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
1512 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
1515 ;; arch-tag: 97c71396-db02-4f41-8b48-6a51c3348fcc
1516 ;;; ediff.el ends here