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
"November 22, 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 of the License, or
24 ;; (at your option) any later version.
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. If not, see <http://www.gnu.org/licenses/>.
36 ;; Never read that diff output again!
37 ;; Apply patch interactively!
40 ;; This package provides a convenient way of simultaneous browsing through
41 ;; the differences between a pair (or a triple) of files or buffers. The
42 ;; files being compared, file-A, file-B, and file-C (if applicable) are
43 ;; shown in separate windows (side by side, one above the another, or in
44 ;; separate frames), and the differences are highlighted as you step
45 ;; through them. You can also copy difference regions from one buffer to
46 ;; another (and recover old differences if you change your mind).
48 ;; Ediff also supports merging operations on files and buffers, including
49 ;; merging using ancestor versions. Both comparison and merging operations can
50 ;; be performed on directories, i.e., by pairwise comparison of files in those
53 ;; In addition, Ediff can apply a patch to a file and then let you step
54 ;; though both files, the patched and the original one, simultaneously,
55 ;; difference-by-difference. You can even apply a patch right out of a
56 ;; mail buffer, i.e., patches received by mail don't even have to be saved.
57 ;; Since Ediff lets you copy differences between buffers, you can, in
58 ;; effect, apply patches selectively (i.e., you can copy a difference
59 ;; region from file_orig to file, thereby undoing any particular patch that
62 ;; Ediff is aware of version control, which lets the user compare
63 ;; files with their older versions. Ediff can also work with remote and
64 ;; compressed files. Details are given below.
66 ;; Finally, Ediff supports directory-level comparison, merging and patching.
67 ;; See the on-line manual for details.
69 ;; This package builds upon the ideas borrowed from emerge.el and several
70 ;; Ediff's functions are adaptations from emerge.el. Much of the functionality
71 ;; Ediff provides is also influenced by emerge.el.
73 ;; The present version of Ediff supersedes Emerge. It provides a superior user
74 ;; interface and has numerous major features not found in Emerge. In
75 ;; particular, it can do patching, and 2-way and 3-way file comparison,
76 ;; merging, and directory operations.
82 ;; 1. The undo command doesn't restore deleted regions well. That is, if
83 ;; you delete all characters in a difference region and then invoke
84 ;; `undo', the reinstated text will most likely be inserted outside of
85 ;; what Ediff thinks is the current difference region. (This problem
86 ;; doesn't seem to exist with XEmacs.)
88 ;; If at any point you feel that difference regions are no longer correct,
89 ;; you can hit '!' to recompute the differences.
91 ;; 2. On a monochrome display, the repertoire of faces with which to
92 ;; highlight fine differences is limited. By default, Ediff is using
93 ;; underlining. However, if the region is already underlined by some other
94 ;; overlays, there is no simple way to temporarily remove that residual
95 ;; underlining. This problem occurs when a buffer is highlighted with
96 ;; hilit19.el or font-lock.el packages. If this residual highlighting gets
97 ;; in the way, you can do the following. Both font-lock.el and hilit19.el
98 ;; provide commands for unhighlighting buffers. You can either place these
99 ;; commands in `ediff-prepare-buffer-hook' (which will unhighlight every
100 ;; buffer used by Ediff) or you can execute them interactively, at any time
101 ;; and on any buffer.
104 ;;; Acknowledgements:
106 ;; Ediff was inspired by Dale R. Worley's <drw@math.mit.edu> emerge.el.
107 ;; Ediff would not have been possible without the help and encouragement of
108 ;; its many users. See Ediff on-line Info for the full list of those who
109 ;; helped. Improved defaults in Ediff file-name reading commands.
117 (unless (fboundp 'declare-function
) (defmacro declare-function
(&rest r
))))
122 (require 'ediff-util
)
123 (require 'ediff-ptch
))
126 (require 'ediff-init
)
127 (require 'ediff-mult
) ; required because of the registry stuff
130 "A comprehensive visual interface to diff & patch."
135 (defcustom ediff-use-last-dir nil
136 "*If t, Ediff will use previous directory as default when reading file name."
140 ;; Last directory used by an Ediff command for file-A.
141 (defvar ediff-last-dir-A nil
)
142 ;; Last directory used by an Ediff command for file-B.
143 (defvar ediff-last-dir-B nil
)
144 ;; Last directory used by an Ediff command for file-C.
145 (defvar ediff-last-dir-C nil
)
146 ;; Last directory used by an Ediff command for the ancestor file.
147 (defvar ediff-last-dir-ancestor nil
)
148 ;; Last directory used by an Ediff command as the output directory for merge.
149 (defvar ediff-last-merge-autostore-dir nil
)
152 ;; Used as a startup hook to set `_orig' patch file read-only.
153 (defun ediff-set-read-only-in-buf-A ()
154 (ediff-with-current-buffer ediff-buffer-A
155 (toggle-read-only 1)))
157 ;; Return a plausible default for ediff's first file:
158 ;; In dired, return the file number FILENO (or 0) in the list
159 ;; (all-selected-files, filename under the cursor), where directories are
160 ;; ignored. Otherwise, return DEFAULT file name, if non-nil. Else,
161 ;; if the buffer is visiting a file, return that file name.
162 (defun ediff-get-default-file-name (&optional default fileno
)
163 (cond ((eq major-mode
'dired-mode
)
164 (let ((current (dired-get-filename nil
'no-error
))
165 (marked (condition-case nil
166 (dired-get-marked-files 'no-dir
)
168 aux-list choices result
)
169 (or (integerp fileno
) (setq fileno
0))
170 (if (stringp default
)
171 (setq aux-list
(cons default aux-list
)))
172 (if (and (stringp current
) (not (file-directory-p current
)))
173 (setq aux-list
(cons current aux-list
)))
174 (setq choices
(nconc marked aux-list
))
175 (setq result
(elt choices fileno
))
178 ((stringp default
) default
)
179 ((buffer-file-name (current-buffer))
180 (file-name-nondirectory (buffer-file-name (current-buffer))))
183 ;;; Compare files/buffers
186 (defun ediff-files (file-A file-B
&optional startup-hooks
)
187 "Run Ediff on a pair of files, FILE-A and FILE-B."
189 (let ((dir-A (if ediff-use-last-dir
193 (list (setq f
(ediff-read-file-name
196 (ediff-get-default-file-name)
198 (ediff-read-file-name "File B to compare"
200 (if ediff-use-last-dir
202 (file-name-directory f
)))
204 (ediff-add-to-history
206 (ediff-abbreviate-file-name
208 (file-name-nondirectory f
)
210 (ediff-get-default-file-name f
1)))
212 (ediff-files-internal file-A
213 (if (file-directory-p file-B
)
215 (file-name-nondirectory file-A
) file-B
)
222 (defun ediff-files3 (file-A file-B file-C
&optional startup-hooks
)
223 "Run Ediff on three files, FILE-A, FILE-B, and FILE-C."
225 (let ((dir-A (if ediff-use-last-dir
229 (list (setq f
(ediff-read-file-name
232 (ediff-get-default-file-name)
234 (setq ff
(ediff-read-file-name "File B to compare"
236 (if ediff-use-last-dir
238 (file-name-directory f
)))
240 (ediff-add-to-history
242 (ediff-abbreviate-file-name
244 (file-name-nondirectory f
)
246 (ediff-get-default-file-name f
1))))
247 (ediff-read-file-name "File C to compare"
248 (setq dir-C
(if ediff-use-last-dir
250 (file-name-directory ff
)))
252 (ediff-add-to-history
254 (ediff-abbreviate-file-name
256 (file-name-nondirectory ff
)
258 (ediff-get-default-file-name ff
2)))
260 (ediff-files-internal file-A
261 (if (file-directory-p file-B
)
263 (file-name-nondirectory file-A
) file-B
)
265 (if (file-directory-p file-C
)
267 (file-name-nondirectory file-A
) file-C
)
273 (defalias 'ediff3
'ediff-files3
)
276 ;; Visit FILE and arrange its buffer to Ediff's liking.
277 ;; FILE is actually a variable symbol that must contain a true file name.
278 ;; BUFFER-NAME is a variable symbol, which will get the buffer object into
279 ;; which FILE is read.
280 ;; LAST-DIR is the directory variable symbol where FILE's
281 ;; directory name should be returned. HOOKS-VAR is a variable symbol that will
282 ;; be assigned the hook to be executed after `ediff-startup' is finished.
283 ;; `ediff-find-file' arranges that the temp files it might create will be
285 (defun ediff-find-file (file-var buffer-name
&optional last-dir hooks-var
)
286 (let* ((file (symbol-value file-var
))
287 (file-magic (ediff-filename-magic-p file
))
288 (temp-file-name-prefix (file-name-nondirectory file
)))
289 (cond ((not (file-readable-p file
))
290 (error "File `%s' does not exist or is not readable" file
))
291 ((file-directory-p file
)
292 (error "File `%s' is a directory" file
)))
294 ;; some of the commands, below, require full file name
295 (setq file
(expand-file-name file
))
297 ;; Record the directory of the file
299 (set last-dir
(expand-file-name (file-name-directory file
))))
302 (set buffer-name
(find-file-noselect file
))
304 (ediff-with-current-buffer (symbol-value buffer-name
)
305 (widen) ; Make sure the entire file is seen
306 (cond (file-magic ; file has a handler, such as jka-compr-handler or
307 ;;; ange-ftp-hook-function--arrange for temp file
308 (ediff-verify-file-buffer 'magic
)
310 (ediff-make-temp-file
311 (current-buffer) temp-file-name-prefix
))
312 (set hooks-var
(cons `(lambda () (delete-file ,file
))
313 (symbol-value hooks-var
))))
314 ;; file processed via auto-mode-alist, a la uncompress.el
315 ((not (equal (file-truename file
)
316 (file-truename (buffer-file-name))))
318 (ediff-make-temp-file
319 (current-buffer) temp-file-name-prefix
))
320 (set hooks-var
(cons `(lambda () (delete-file ,file
))
321 (symbol-value hooks-var
))))
322 (t ;; plain file---just check that the file matches the buffer
323 (ediff-verify-file-buffer))))
324 (set file-var file
)))
326 ;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
327 (defun ediff-files-internal (file-A file-B file-C startup-hooks job-name
328 &optional merge-buffer-file
)
329 (let (buf-A buf-B buf-C
)
330 (if (string= file-A file-B
)
331 (error "Files A and B are the same"))
333 (or (and (string= file-A file-C
) (error "Files A and C are the same"))
334 (and (string= file-B file-C
) (error "Files B and C are the same"))))
335 (message "Reading file %s ... " file-A
)
337 (ediff-find-file 'file-A
'buf-A
'ediff-last-dir-A
'startup-hooks
)
338 (message "Reading file %s ... " file-B
)
340 (ediff-find-file 'file-B
'buf-B
'ediff-last-dir-B
'startup-hooks
)
343 (message "Reading file %s ... " file-C
)
347 (if (eq job-name
'ediff-merge-files-with-ancestor
)
348 'ediff-last-dir-ancestor
'ediff-last-dir-C
)
350 (ediff-setup buf-A file-A
354 (list (cons 'ediff-job-name job-name
))
357 (declare-function diff-latest-backup-file
"diff" (fn))
360 (defalias 'ediff
'ediff-files
)
363 (defun ediff-backup (file)
364 "Run Ediff on FILE and its backup file.
365 Uses the latest backup, if there are several numerical backups.
366 If this file is a backup, `ediff' it with its original."
367 (interactive (list (read-file-name "Ediff (file with backup): ")))
368 ;; The code is taken from `diff-backup'.
371 (if (backup-file-name-p file
)
373 ori
(file-name-sans-versions file
))
374 (setq bak
(or (diff-latest-backup-file file
)
375 (error "No backup found for %s" file
))
377 (ediff-files bak ori
)))
380 (defun ediff-buffers (buffer-A buffer-B
&optional startup-hooks job-name
)
381 "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B."
384 (list (setq bf
(read-buffer "Buffer A to compare: "
385 (ediff-other-buffer "") t
))
386 (read-buffer "Buffer B to compare: "
388 ;; realign buffers so that two visible bufs will be
390 (save-window-excursion (other-window 1))
391 (ediff-other-buffer bf
))
393 (or job-name
(setq job-name
'ediff-buffers
))
394 (ediff-buffers-internal buffer-A buffer-B nil startup-hooks job-name
))
397 (defalias 'ebuffers
'ediff-buffers
)
401 (defun ediff-buffers3 (buffer-A buffer-B buffer-C
402 &optional startup-hooks job-name
)
403 "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C."
406 (list (setq bf
(read-buffer "Buffer A to compare: "
407 (ediff-other-buffer "") t
))
408 (setq bff
(read-buffer "Buffer B to compare: "
410 ;; realign buffers so that two visible
411 ;; bufs will be at the top
412 (save-window-excursion (other-window 1))
413 (ediff-other-buffer bf
))
415 (read-buffer "Buffer C to compare: "
417 ;; realign buffers so that three visible
418 ;; bufs will be at the top
419 (save-window-excursion (other-window 1))
420 (ediff-other-buffer (list bf bff
)))
423 (or job-name
(setq job-name
'ediff-buffers3
))
424 (ediff-buffers-internal buffer-A buffer-B buffer-C startup-hooks job-name
))
427 (defalias 'ebuffers3
'ediff-buffers3
)
431 ;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
432 (defun ediff-buffers-internal (buf-A buf-B buf-C startup-hooks job-name
433 &optional merge-buffer-file
)
434 (let* ((buf-A-file-name (buffer-file-name (get-buffer buf-A
)))
435 (buf-B-file-name (buffer-file-name (get-buffer buf-B
)))
436 (buf-C-is-alive (ediff-buffer-live-p buf-C
))
437 (buf-C-file-name (if buf-C-is-alive
438 (buffer-file-name (get-buffer buf-B
))))
439 file-A file-B file-C
)
440 (if (not (ediff-buffer-live-p buf-A
))
441 (error "Buffer %S doesn't exist" buf-A
))
442 (if (not (ediff-buffer-live-p buf-B
))
443 (error "Buffer %S doesn't exist" buf-B
))
444 (let ((ediff-job-name job-name
))
445 (if (and ediff-3way-comparison-job
446 (not buf-C-is-alive
))
447 (error "Buffer %S doesn't exist" buf-C
)))
448 (if (stringp buf-A-file-name
)
449 (setq buf-A-file-name
(file-name-nondirectory buf-A-file-name
)))
450 (if (stringp buf-B-file-name
)
451 (setq buf-B-file-name
(file-name-nondirectory buf-B-file-name
)))
452 (if (stringp buf-C-file-name
)
453 (setq buf-C-file-name
(file-name-nondirectory buf-C-file-name
)))
455 (setq file-A
(ediff-make-temp-file buf-A buf-A-file-name
)
456 file-B
(ediff-make-temp-file buf-B buf-B-file-name
))
458 (setq file-C
(ediff-make-temp-file buf-C buf-C-file-name
)))
460 (ediff-setup (get-buffer buf-A
) file-A
461 (get-buffer buf-B
) file-B
462 (if buf-C-is-alive
(get-buffer buf-C
))
465 (delete-file ,file-A
)
466 (delete-file ,file-B
)
467 (if (stringp ,file-C
) (delete-file ,file-C
)))
469 (list (cons 'ediff-job-name job-name
))
473 ;;; Directory and file group operations
475 ;; Get appropriate default name for directory:
476 ;; If ediff-use-last-dir, use ediff-last-dir-A.
477 ;; In dired mode, use the directory that is under the point (if any);
478 ;; otherwise, use default-directory
479 (defun ediff-get-default-directory-name ()
480 (cond (ediff-use-last-dir ediff-last-dir-A
)
481 ((eq major-mode
'dired-mode
)
482 (let ((f (dired-get-filename nil
'noerror
)))
483 (if (and (stringp f
) (file-directory-p f
))
486 (t default-directory
)))
490 (defun ediff-directories (dir1 dir2 regexp
)
491 "Run Ediff on a pair of directories, DIR1 and DIR2, comparing files that have
492 the same name in both. The third argument, REGEXP, is nil or a regular
493 expression; only file names that match the regexp are considered."
495 (let ((dir-A (ediff-get-default-directory-name))
496 (default-regexp (eval ediff-default-filtering-regexp
))
498 (list (setq f
(read-directory-name
499 "Directory A to compare:" dir-A nil
'must-match
))
500 (read-directory-name "Directory B to compare:"
501 (if ediff-use-last-dir
503 (ediff-strip-last-dir f
))
506 (if (stringp default-regexp
)
507 (format "Filter through regular expression (default %s): "
509 "Filter through regular expression: ")
511 'ediff-filtering-regexp-history
512 (eval ediff-default-filtering-regexp
))
514 (ediff-directories-internal
515 dir1 dir2 nil regexp
'ediff-files
'ediff-directories
519 (defalias 'edirs
'ediff-directories
)
523 (defun ediff-directory-revisions (dir1 regexp
)
524 "Run Ediff on a directory, DIR1, comparing its files with their revisions.
525 The second argument, REGEXP, is a regular expression that filters the file
526 names. Only the files that are under revision control are taken into account."
528 (let ((dir-A (ediff-get-default-directory-name))
529 (default-regexp (eval ediff-default-filtering-regexp
))
531 (list (read-directory-name
532 "Directory to compare with revision:" dir-A nil
'must-match
)
534 (if (stringp default-regexp
)
535 (format "Filter through regular expression (default %s): "
537 "Filter through regular expression: ")
539 'ediff-filtering-regexp-history
540 (eval ediff-default-filtering-regexp
))
542 (ediff-directory-revisions-internal
543 dir1 regexp
'ediff-revision
'ediff-directory-revisions
547 (defalias 'edir-revisions
'ediff-directory-revisions
)
551 (defun ediff-directories3 (dir1 dir2 dir3 regexp
)
552 "Run Ediff on three directories, DIR1, DIR2, and DIR3, comparing files that
553 have the same name in all three. The last argument, REGEXP, is nil or a
554 regular expression; only file names that match the regexp are considered."
557 (let ((dir-A (ediff-get-default-directory-name))
558 (default-regexp (eval ediff-default-filtering-regexp
))
560 (list (setq f
(read-directory-name "Directory A to compare:" dir-A nil
))
561 (setq f
(read-directory-name "Directory B to compare:"
562 (if ediff-use-last-dir
564 (ediff-strip-last-dir f
))
566 (read-directory-name "Directory C to compare:"
567 (if ediff-use-last-dir
569 (ediff-strip-last-dir f
))
572 (if (stringp default-regexp
)
573 (format "Filter through regular expression (default %s): "
575 "Filter through regular expression: ")
577 'ediff-filtering-regexp-history
578 (eval ediff-default-filtering-regexp
))
580 (ediff-directories-internal
581 dir1 dir2 dir3 regexp
'ediff-files3
'ediff-directories3
585 (defalias 'edirs3
'ediff-directories3
)
588 (defun ediff-merge-directories (dir1 dir2 regexp
&optional merge-autostore-dir
)
589 "Run Ediff on a pair of directories, DIR1 and DIR2, merging files that have
590 the same name in both. The third argument, REGEXP, is nil or a regular
591 expression; only file names that match the regexp are considered."
593 (let ((dir-A (ediff-get-default-directory-name))
594 (default-regexp (eval ediff-default-filtering-regexp
))
596 (list (setq f
(read-directory-name "Directory A to merge:"
597 dir-A nil
'must-match
))
598 (read-directory-name "Directory B to merge:"
599 (if ediff-use-last-dir
601 (ediff-strip-last-dir f
))
604 (if (stringp default-regexp
)
605 (format "Filter through regular expression (default %s): "
607 "Filter through regular expression: ")
609 'ediff-filtering-regexp-history
610 (eval ediff-default-filtering-regexp
))
612 (ediff-directories-internal
613 dir1 dir2 nil regexp
'ediff-merge-files
'ediff-merge-directories
614 nil merge-autostore-dir
618 (defalias 'edirs-merge
'ediff-merge-directories
)
621 (defun ediff-merge-directories-with-ancestor (dir1 dir2 ancestor-dir regexp
624 "Merge files in directories DIR1 and DIR2 using files in ANCESTOR-DIR as ancestors.
625 Ediff merges files that have identical names in DIR1, DIR2. If a pair of files
626 in DIR1 and DIR2 doesn't have an ancestor in ANCESTOR-DIR, Ediff will merge
627 without ancestor. The fourth argument, REGEXP, is nil or a regular expression;
628 only file names that match the regexp are considered."
630 (let ((dir-A (ediff-get-default-directory-name))
631 (default-regexp (eval ediff-default-filtering-regexp
))
633 (list (setq f
(read-directory-name "Directory A to merge:" dir-A nil
))
634 (setq f
(read-directory-name "Directory B to merge:"
635 (if ediff-use-last-dir
637 (ediff-strip-last-dir f
))
639 (read-directory-name "Ancestor directory:"
640 (if ediff-use-last-dir
642 (ediff-strip-last-dir f
))
645 (if (stringp default-regexp
)
646 (format "Filter through regular expression (default %s): "
648 "Filter through regular expression: ")
650 'ediff-filtering-regexp-history
651 (eval ediff-default-filtering-regexp
))
653 (ediff-directories-internal
654 dir1 dir2 ancestor-dir regexp
655 'ediff-merge-files-with-ancestor
'ediff-merge-directories-with-ancestor
656 nil merge-autostore-dir
660 (defun ediff-merge-directory-revisions (dir1 regexp
661 &optional merge-autostore-dir
)
662 "Run Ediff on a directory, DIR1, merging its files with their revisions.
663 The second argument, REGEXP, is a regular expression that filters the file
664 names. Only the files that are under revision control are taken into account."
666 (let ((dir-A (ediff-get-default-directory-name))
667 (default-regexp (eval ediff-default-filtering-regexp
))
669 (list (read-directory-name
670 "Directory to merge with revisions:" dir-A nil
'must-match
)
672 (if (stringp default-regexp
)
673 (format "Filter through regular expression (default %s): "
675 "Filter through regular expression: ")
677 'ediff-filtering-regexp-history
678 (eval ediff-default-filtering-regexp
))
680 (ediff-directory-revisions-internal
681 dir1 regexp
'ediff-merge-revisions
'ediff-merge-directory-revisions
682 nil merge-autostore-dir
686 (defalias 'edir-merge-revisions
'ediff-merge-directory-revisions
)
689 (defun ediff-merge-directory-revisions-with-ancestor (dir1 regexp
692 "Run Ediff on a directory, DIR1, merging its files with their revisions and ancestors.
693 The second argument, REGEXP, is a regular expression that filters the file
694 names. Only the files that are under revision control are taken into account."
696 (let ((dir-A (ediff-get-default-directory-name))
697 (default-regexp (eval ediff-default-filtering-regexp
))
699 (list (read-directory-name
700 "Directory to merge with revisions and ancestors:"
701 dir-A nil
'must-match
)
703 (if (stringp default-regexp
)
704 (format "Filter through regular expression (default %s): "
706 "Filter through regular expression: ")
708 'ediff-filtering-regexp-history
709 (eval ediff-default-filtering-regexp
))
711 (ediff-directory-revisions-internal
712 dir1 regexp
'ediff-merge-revisions-with-ancestor
713 'ediff-merge-directory-revisions-with-ancestor
714 nil merge-autostore-dir
719 'edir-merge-revisions-with-ancestor
720 'ediff-merge-directory-revisions-with-ancestor
)
723 (defalias 'edirs-merge-with-ancestor
'ediff-merge-directories-with-ancestor
)
725 ;; Run ediff-action (ediff-files, ediff-merge, ediff-merge-with-ancestors)
726 ;; on a pair of directories (three directories, in case of ancestor).
727 ;; The third argument, REGEXP, is nil or a regular expression;
728 ;; only file names that match the regexp are considered.
729 ;; JOBNAME is the symbol indicating the meta-job to be performed.
730 ;; MERGE-AUTOSTORE-DIR is the directory in which to store merged files.
731 (defun ediff-directories-internal (dir1 dir2 dir3 regexp action jobname
732 &optional startup-hooks
735 (setq dir3
(if (file-directory-p dir3
) dir3
(file-name-directory dir3
))))
737 (cond ((string= dir1 dir2
)
738 (error "Directories A and B are the same: %s" dir1
))
739 ((and (eq jobname
'ediff-directories3
)
741 (error "Directories A and C are the same: %s" dir1
))
742 ((and (eq jobname
'ediff-directories3
)
744 (error "Directories B and C are the same: %s" dir1
)))
746 (if merge-autostore-dir
747 (or (stringp merge-autostore-dir
)
748 (error "%s: Directory for storing merged files must be a string"
750 (let (;; dir-diff-struct is of the form (common-list diff-list)
751 ;; It is a structure where ediff-intersect-directories returns
752 ;; commonalities and differences among directories
755 (if (and ediff-autostore-merges
756 (ediff-merge-metajob jobname
)
757 (not merge-autostore-dir
))
758 (setq merge-autostore-dir
759 (read-directory-name "Save merged files in directory: "
760 (if ediff-use-last-dir
761 ediff-last-merge-autostore-dir
762 (ediff-strip-last-dir dir1
))
765 ;; verify we are not merging into an orig directory
766 (if merge-autostore-dir
767 (cond ((and (stringp dir1
) (string= merge-autostore-dir dir1
))
769 "Directory for saving merged files = Directory A. Sure? ")
770 (error "Directory merge aborted")))
771 ((and (stringp dir2
) (string= merge-autostore-dir dir2
))
773 "Directory for saving merged files = Directory B. Sure? ")
774 (error "Directory merge aborted")))
775 ((and (stringp dir3
) (string= merge-autostore-dir dir3
))
777 "Directory for saving merged files = Ancestor Directory. Sure? ")
778 (error "Directory merge aborted")))))
780 (setq dir-diff-struct
(ediff-intersect-directories
782 regexp dir1 dir2 dir3 merge-autostore-dir
))
784 ;; this sets various vars in the meta buffer inside
785 ;; ediff-prepare-meta-buffer
787 ;; tell what to do if the user clicks on a session record
788 (setq ediff-session-action-function
(quote ,action
))
789 ;; set ediff-dir-difference-list
790 (setq ediff-dir-difference-list
791 (cdr (quote ,dir-diff-struct
))))
793 (setq meta-buf
(ediff-prepare-meta-buffer
794 'ediff-filegroup-action
795 (car dir-diff-struct
)
796 "*Ediff Session Group Panel"
797 'ediff-redraw-directory-group-buffer
800 (ediff-show-meta-buffer meta-buf
)
803 ;; MERGE-AUTOSTORE-DIR can be given to tell ediff where to store the merged
805 (defun ediff-directory-revisions-internal (dir1 regexp action jobname
806 &optional startup-hooks
808 (setq dir1
(if (file-directory-p dir1
) dir1
(file-name-directory dir1
)))
810 (if merge-autostore-dir
811 (or (stringp merge-autostore-dir
)
812 (error "%S: Directory for storing merged files must be a string"
814 (let (file-list meta-buf
)
815 (if (and ediff-autostore-merges
816 (ediff-merge-metajob jobname
)
817 (not merge-autostore-dir
))
818 (setq merge-autostore-dir
819 (read-directory-name "Save merged files in directory: "
820 (if ediff-use-last-dir
821 ediff-last-merge-autostore-dir
822 (ediff-strip-last-dir dir1
))
825 ;; verify merge-autostore-dir != dir1
826 (if (and merge-autostore-dir
828 (string= merge-autostore-dir dir1
))
830 "Directory for saving merged file = directory A. Sure? ")
831 (error "Merge of directory revisions aborted")))
834 (ediff-get-directory-files-under-revision
835 jobname regexp dir1 merge-autostore-dir
))
837 ;; this sets various vars in the meta buffer inside
838 ;; ediff-prepare-meta-buffer
840 ;; tell what to do if the user clicks on a session record
841 (setq ediff-session-action-function
(quote ,action
)))
843 (setq meta-buf
(ediff-prepare-meta-buffer
844 'ediff-filegroup-action
846 "*Ediff Session Group Panel"
847 'ediff-redraw-directory-group-buffer
850 (ediff-show-meta-buffer meta-buf
)
854 ;;; Compare regions and windows
857 (defun ediff-windows-wordwise (dumb-mode &optional wind-A wind-B startup-hooks
)
858 "Compare WIND-A and WIND-B, which are selected by clicking, wordwise.
859 With prefix argument, DUMB-MODE, or on a non-windowing display, works as
861 If WIND-A is nil, use selected window.
862 If WIND-B is nil, use window next to WIND-A."
864 (ediff-windows dumb-mode wind-A wind-B
865 startup-hooks
'ediff-windows-wordwise
'word-mode
))
868 (defun ediff-windows-linewise (dumb-mode &optional wind-A wind-B startup-hooks
)
869 "Compare WIND-A and WIND-B, which are selected by clicking, linewise.
870 With prefix argument, DUMB-MODE, or on a non-windowing display, works as
872 If WIND-A is nil, use selected window.
873 If WIND-B is nil, use window next to WIND-A."
875 (ediff-windows dumb-mode wind-A wind-B
876 startup-hooks
'ediff-windows-linewise nil
))
878 ;; Compare WIND-A and WIND-B, which are selected by clicking.
879 ;; With prefix argument, DUMB-MODE, or on a non-windowing display,
881 ;; If WIND-A is nil, use selected window.
882 ;; If WIND-B is nil, use window next to WIND-A.
883 (defun ediff-windows (dumb-mode wind-A wind-B startup-hooks job-name word-mode
)
884 (if (or dumb-mode
(not (ediff-window-display-p)))
885 (setq wind-A
(ediff-get-next-window wind-A nil
)
886 wind-B
(ediff-get-next-window wind-B wind-A
))
887 (setq wind-A
(ediff-get-window-by-clicking wind-A nil
1)
888 wind-B
(ediff-get-window-by-clicking wind-B wind-A
2)))
890 (let ((buffer-A (window-buffer wind-A
))
891 (buffer-B (window-buffer wind-B
))
892 beg-A end-A beg-B end-B
)
895 (save-window-excursion
896 (sit-for 0) ; sync before using window-start/end -- a precaution
897 (select-window wind-A
)
898 (setq beg-A
(window-start)
900 (select-window wind-B
)
901 (setq beg-B
(window-start)
902 end-B
(window-end))))
904 (ediff-clone-buffer-for-window-comparison
905 buffer-A wind-A
"-Window.A-")
907 (ediff-clone-buffer-for-window-comparison
908 buffer-B wind-B
"-Window.B-"))
909 (ediff-regions-internal
910 buffer-A beg-A end-A buffer-B beg-B end-B
911 startup-hooks job-name word-mode nil
)))
915 (defun ediff-regions-wordwise (buffer-A buffer-B
&optional startup-hooks
)
916 "Run Ediff on a pair of regions in specified buffers.
917 Regions \(i.e., point and mark\) can be set in advance or marked interactively.
918 This function is effective only for relatively small regions, up to 200
919 lines. For large regions, use `ediff-regions-linewise'."
922 (list (setq bf
(read-buffer "Region's A buffer: "
923 (ediff-other-buffer "") t
))
924 (read-buffer "Region's B buffer: "
926 ;; realign buffers so that two visible bufs will be
928 (save-window-excursion (other-window 1))
929 (ediff-other-buffer bf
))
931 (if (not (ediff-buffer-live-p buffer-A
))
932 (error "Buffer %S doesn't exist" buffer-A
))
933 (if (not (ediff-buffer-live-p buffer-B
))
934 (error "Buffer %S doesn't exist" buffer-B
))
938 (ediff-clone-buffer-for-region-comparison buffer-A
"-Region.A-"))
940 (ediff-clone-buffer-for-region-comparison buffer-B
"-Region.B-"))
941 reg-A-beg reg-A-end reg-B-beg reg-B-end
)
943 (set-buffer buffer-A
)
944 (setq reg-A-beg
(region-beginning)
945 reg-A-end
(region-end))
946 (set-buffer buffer-B
)
947 (setq reg-B-beg
(region-beginning)
948 reg-B-end
(region-end)))
950 (ediff-regions-internal
951 (get-buffer buffer-A
) reg-A-beg reg-A-end
952 (get-buffer buffer-B
) reg-B-beg reg-B-end
953 startup-hooks
'ediff-regions-wordwise
'word-mode nil
)))
956 (defun ediff-regions-linewise (buffer-A buffer-B
&optional startup-hooks
)
957 "Run Ediff on a pair of regions in specified buffers.
958 Regions \(i.e., point and mark\) can be set in advance or marked interactively.
959 Each region is enlarged to contain full lines.
960 This function is effective for large regions, over 100-200
961 lines. For small regions, use `ediff-regions-wordwise'."
964 (list (setq bf
(read-buffer "Region A's buffer: "
965 (ediff-other-buffer "") t
))
966 (read-buffer "Region B's buffer: "
968 ;; realign buffers so that two visible bufs will be
970 (save-window-excursion (other-window 1))
971 (ediff-other-buffer bf
))
973 (if (not (ediff-buffer-live-p buffer-A
))
974 (error "Buffer %S doesn't exist" buffer-A
))
975 (if (not (ediff-buffer-live-p buffer-B
))
976 (error "Buffer %S doesn't exist" buffer-B
))
979 (ediff-clone-buffer-for-region-comparison buffer-A
"-Region.A-"))
981 (ediff-clone-buffer-for-region-comparison buffer-B
"-Region.B-"))
982 reg-A-beg reg-A-end reg-B-beg reg-B-end
)
984 (set-buffer buffer-A
)
985 (setq reg-A-beg
(region-beginning)
986 reg-A-end
(region-end))
987 ;; enlarge the region to hold full lines
988 (goto-char reg-A-beg
)
990 (setq reg-A-beg
(point))
991 (goto-char reg-A-end
)
993 (or (eobp) (forward-char)) ; include the newline char
994 (setq reg-A-end
(point))
996 (set-buffer buffer-B
)
997 (setq reg-B-beg
(region-beginning)
998 reg-B-end
(region-end))
999 ;; enlarge the region to hold full lines
1000 (goto-char reg-B-beg
)
1002 (setq reg-B-beg
(point))
1003 (goto-char reg-B-end
)
1005 (or (eobp) (forward-char)) ; include the newline char
1006 (setq reg-B-end
(point))
1009 (ediff-regions-internal
1010 (get-buffer buffer-A
) reg-A-beg reg-A-end
1011 (get-buffer buffer-B
) reg-B-beg reg-B-end
1012 startup-hooks
'ediff-regions-linewise nil nil
))) ; no word mode
1014 ;; compare region beg-A to end-A of buffer-A
1015 ;; to regions beg-B -- end-B in buffer-B.
1016 (defun ediff-regions-internal (buffer-A beg-A end-A buffer-B beg-B end-B
1017 startup-hooks job-name word-mode
1019 (let ((tmp-buffer (get-buffer-create ediff-tmp-buffer
))
1023 ;; in case beg/end-A/B aren't markers--make them into markers
1024 (ediff-with-current-buffer buffer-A
1025 (setq beg-A
(move-marker (make-marker) beg-A
)
1026 end-A
(move-marker (make-marker) end-A
)))
1027 (ediff-with-current-buffer buffer-B
1028 (setq beg-B
(move-marker (make-marker) beg-B
)
1029 end-B
(move-marker (make-marker) end-B
)))
1033 (ediff-wordify beg-A end-A buffer-A tmp-buffer
)
1034 (ediff-copy-to-buffer beg-A end-A buffer-A tmp-buffer
))
1035 (setq file-A
(ediff-make-temp-file tmp-buffer
"regA"))
1039 (ediff-wordify beg-B end-B buffer-B tmp-buffer
)
1040 (ediff-copy-to-buffer beg-B end-B buffer-B tmp-buffer
))
1041 (setq file-B
(ediff-make-temp-file tmp-buffer
"regB"))
1043 (setq overl-A
(ediff-make-bullet-proof-overlay beg-A end-A buffer-A
))
1044 (setq overl-B
(ediff-make-bullet-proof-overlay beg-B end-B buffer-B
))
1045 (ediff-setup buffer-A file-A
1047 nil nil
; buffer & file C
1049 (delete-file ,file-A
)
1050 (delete-file ,file-B
))
1053 (list (cons 'ediff-word-mode word-mode
)
1054 (cons 'ediff-narrow-bounds
(list overl-A overl-B
))
1055 (cons 'ediff-job-name job-name
))
1060 ;;; Merge files and buffers
1063 (defalias 'ediff-merge
'ediff-merge-files
)
1065 (defsubst ediff-merge-on-startup
()
1067 ;; Can't remember why this is here, but it may cause the automatically merged
1068 ;; buffer to be lost. So, keep the buffer modified.
1069 ;;(ediff-with-current-buffer ediff-buffer-C
1070 ;; (set-buffer-modified-p nil))
1074 (defun ediff-merge-files (file-A file-B
1075 ;; MERGE-BUFFER-FILE is the file to be
1076 ;; associated with the merge buffer
1077 &optional startup-hooks merge-buffer-file
)
1078 "Merge two files without ancestor."
1080 (let ((dir-A (if ediff-use-last-dir
1084 (list (setq f
(ediff-read-file-name
1087 (ediff-get-default-file-name)
1089 (ediff-read-file-name "File B to merge"
1091 (if ediff-use-last-dir
1093 (file-name-directory f
)))
1095 (ediff-add-to-history
1097 (ediff-abbreviate-file-name
1099 (file-name-nondirectory f
)
1101 (ediff-get-default-file-name f
1)))
1103 (setq startup-hooks
(cons 'ediff-merge-on-startup startup-hooks
))
1104 (ediff-files-internal file-A
1105 (if (file-directory-p file-B
)
1107 (file-name-nondirectory file-A
) file-B
)
1115 (defun ediff-merge-files-with-ancestor (file-A file-B file-ancestor
1118 ;; MERGE-BUFFER-FILE is the file
1119 ;; to be associated with the
1122 "Merge two files with ancestor."
1124 (let ((dir-A (if ediff-use-last-dir
1127 dir-B dir-ancestor f ff
)
1128 (list (setq f
(ediff-read-file-name
1131 (ediff-get-default-file-name)
1133 (setq ff
(ediff-read-file-name "File B to merge"
1135 (if ediff-use-last-dir
1137 (file-name-directory f
)))
1139 (ediff-add-to-history
1141 (ediff-abbreviate-file-name
1143 (file-name-nondirectory f
)
1145 (ediff-get-default-file-name f
1))))
1146 (ediff-read-file-name "Ancestor file"
1148 (if ediff-use-last-dir
1149 ediff-last-dir-ancestor
1150 (file-name-directory ff
)))
1152 (ediff-add-to-history
1154 (ediff-abbreviate-file-name
1156 (file-name-nondirectory ff
)
1158 (ediff-get-default-file-name ff
2)))
1160 (setq startup-hooks
(cons 'ediff-merge-on-startup startup-hooks
))
1161 (ediff-files-internal file-A
1162 (if (file-directory-p file-B
)
1164 (file-name-nondirectory file-A
) file-B
)
1168 'ediff-merge-files-with-ancestor
1172 (defalias 'ediff-merge-with-ancestor
'ediff-merge-files-with-ancestor
)
1175 (defun ediff-merge-buffers (buffer-A buffer-B
1177 ;; MERGE-BUFFER-FILE is the file to be
1178 ;; associated with the merge buffer
1179 startup-hooks job-name merge-buffer-file
)
1180 "Merge buffers without ancestor."
1183 (list (setq bf
(read-buffer "Buffer A to merge: "
1184 (ediff-other-buffer "") t
))
1185 (read-buffer "Buffer B to merge: "
1187 ;; realign buffers so that two visible bufs will be
1189 (save-window-excursion (other-window 1))
1190 (ediff-other-buffer bf
))
1193 (setq startup-hooks
(cons 'ediff-merge-on-startup startup-hooks
))
1194 (or job-name
(setq job-name
'ediff-merge-buffers
))
1195 (ediff-buffers-internal
1196 buffer-A buffer-B nil startup-hooks job-name merge-buffer-file
))
1199 (defun ediff-merge-buffers-with-ancestor (buffer-A buffer-B buffer-ancestor
1203 ;; MERGE-BUFFER-FILE is the
1204 ;; file to be associated
1205 ;; with the merge buffer
1207 "Merge buffers with ancestor."
1210 (list (setq bf
(read-buffer "Buffer A to merge: "
1211 (ediff-other-buffer "") t
))
1212 (setq bff
(read-buffer "Buffer B to merge: "
1214 ;; realign buffers so that two visible
1215 ;; bufs will be at the top
1216 (save-window-excursion (other-window 1))
1217 (ediff-other-buffer bf
))
1219 (read-buffer "Ancestor buffer: "
1221 ;; realign buffers so that three visible
1222 ;; bufs will be at the top
1223 (save-window-excursion (other-window 1))
1224 (ediff-other-buffer (list bf bff
)))
1228 (setq startup-hooks
(cons 'ediff-merge-on-startup startup-hooks
))
1229 (or job-name
(setq job-name
'ediff-merge-buffers-with-ancestor
))
1230 (ediff-buffers-internal
1231 buffer-A buffer-B buffer-ancestor startup-hooks job-name merge-buffer-file
))
1235 (defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file
)
1236 ;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
1237 "Run Ediff by merging two revisions of a file.
1238 The file is the optional FILE argument or the file visited by the current
1241 (if (stringp file
) (find-file file
))
1246 "Version 1 to merge (default %s's working version): "
1248 (file-name-nondirectory file
) "current buffer")))
1252 "Version 2 to merge (default %s): "
1254 (file-name-nondirectory file
) "current buffer"))))
1255 (ediff-load-version-control)
1256 ;; ancestor-revision=nil
1258 (intern (format "ediff-%S-merge-internal" ediff-version-control-package
))
1259 rev1 rev2 nil startup-hooks merge-buffer-file
)))
1263 (defun ediff-merge-revisions-with-ancestor (&optional
1265 ;; MERGE-BUFFER-FILE is the file to
1266 ;; be associated with the merge
1269 "Run Ediff by merging two revisions of a file with a common ancestor.
1270 The file is the optional FILE argument or the file visited by the current
1273 (if (stringp file
) (find-file file
))
1274 (let (rev1 rev2 ancestor-rev
)
1278 "Version 1 to merge (default %s's working version): "
1280 (file-name-nondirectory file
) "current buffer")))
1284 "Version 2 to merge (default %s): "
1286 (file-name-nondirectory file
) "current buffer")))
1290 "Ancestor version (default %s's base revision): "
1292 (file-name-nondirectory file
) "current buffer"))))
1293 (ediff-load-version-control)
1295 (intern (format "ediff-%S-merge-internal" ediff-version-control-package
))
1296 rev1 rev2 ancestor-rev startup-hooks merge-buffer-file
)))
1301 (defun ediff-patch-file (&optional arg patch-buf
)
1302 "Run Ediff by patching SOURCE-FILENAME.
1303 If optional PATCH-BUF is given, use the patch in that buffer
1304 and don't ask the user.
1305 If prefix argument, then: if even argument, assume that the patch is in a
1306 buffer. If odd -- assume it is in a file."
1308 (let (source-dir source-file
)
1309 (require 'ediff-ptch
)
1311 (ediff-get-patch-buffer
1312 (if arg
(prefix-numeric-value arg
)) patch-buf
))
1313 (setq source-dir
(cond (ediff-use-last-dir ediff-last-dir-patch
)
1314 ((and (not ediff-patch-default-directory
)
1315 (buffer-file-name patch-buf
))
1316 (file-name-directory
1318 (buffer-file-name patch-buf
))))
1319 (t default-directory
)))
1322 "File to patch (directory, if multifile patch): "
1323 ;; use an explicit initial file
1324 source-dir nil nil
(ediff-get-default-file-name)))
1325 (ediff-dispatch-file-patching-job patch-buf source-file
)))
1328 (defun ediff-patch-buffer (&optional arg patch-buf
)
1329 "Run Ediff by patching the buffer specified at prompt.
1330 Without the optional prefix ARG, asks if the patch is in some buffer and
1331 prompts for the buffer or a file, depending on the answer.
1332 With ARG=1, assumes the patch is in a file and prompts for the file.
1333 With ARG=2, assumes the patch is in a buffer and prompts for the buffer.
1334 PATCH-BUF is an optional argument, which specifies the buffer that contains the
1335 patch. If not given, the user is prompted according to the prefix argument."
1337 (require 'ediff-ptch
)
1339 (ediff-get-patch-buffer
1340 (if arg
(prefix-numeric-value arg
)) patch-buf
))
1341 (ediff-patch-buffer-internal
1344 "Which buffer to patch? "
1345 (ediff-other-buffer patch-buf
))))
1349 (defalias 'epatch
'ediff-patch-file
)
1351 (defalias 'epatch-buffer
'ediff-patch-buffer
)
1356 ;;; Versions Control functions
1359 (defun ediff-revision (&optional file startup-hooks
)
1360 "Run Ediff by comparing versions of a file.
1361 The file is an optional FILE argument or the file entered at the prompt.
1362 Default: the file visited by the current buffer.
1363 Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
1364 ;; if buffer is non-nil, use that buffer instead of the current buffer
1366 (if (not (stringp file
))
1368 (ediff-read-file-name "Compare revisions for file"
1369 (if ediff-use-last-dir
1372 (ediff-get-default-file-name)
1375 (if (and (buffer-modified-p)
1376 (y-or-n-p (format "Buffer %s is modified. Save buffer? "
1378 (save-buffer (current-buffer)))
1382 (format "Revision 1 to compare (default %s's latest revision): "
1383 (file-name-nondirectory file
)))
1386 (format "Revision 2 to compare (default %s's current state): "
1387 (file-name-nondirectory file
))))
1388 (ediff-load-version-control)
1390 (intern (format "ediff-%S-internal" ediff-version-control-package
))
1391 rev1 rev2 startup-hooks
)
1396 (defalias 'erevision
'ediff-revision
)
1399 ;; Test if version control package is loaded and load if not
1400 ;; Is SILENT is non-nil, don't report error if package is not found.
1401 (defun ediff-load-version-control (&optional silent
)
1402 (require 'ediff-vers
)
1403 (or (featurep ediff-version-control-package
)
1404 (if (locate-library (symbol-name ediff-version-control-package
))
1406 (message "") ; kill the message from `locate-library'
1407 (require ediff-version-control-package
))
1409 (error "Version control package %S.el not found. Use vc.el instead"
1410 ediff-version-control-package
)))))
1414 (defun ediff-version ()
1415 "Return string describing the version of Ediff.
1416 When called interactively, displays the version."
1419 (message "%s" (ediff-version))
1420 (format "Ediff %s of %s" ediff-version ediff-date
)))
1422 ;; info is run first, and will autoload info.el.
1423 (declare-function Info-goto-node
"info" (nodename &optional fork
))
1426 (defun ediff-documentation (&optional node
)
1427 "Display Ediff's manual.
1428 With optional NODE, goes to that node."
1430 (let ((ctl-window ediff-control-window
)
1431 (ctl-buf ediff-control-buffer
))
1433 (ediff-skip-unsuitable-frames)
1436 (pop-to-buffer (get-buffer-create "*info*"))
1437 (info (if (featurep 'xemacs
) "ediff.info" "ediff"))
1439 (Info-goto-node node
)
1440 (message "Type `i' to search for a specific topic"))
1441 (raise-frame (selected-frame)))
1443 (with-output-to-temp-buffer ediff-msg-buffer
1444 (ediff-with-current-buffer standard-output
1446 (princ ediff-BAD-INFO
))
1447 (if (window-live-p ctl-window
)
1449 (select-window ctl-window
)
1450 (set-window-buffer ctl-window ctl-buf
)))))))
1453 (dolist (mess '("^Errors in diff output. Diff output is in "
1454 "^Hmm... I don't see an Ediff command around here...$"
1455 "^Undocumented command! Type `G' in Ediff Control Panel to drop a note to the Ediff maintainer$"
1456 ": This command runs in Ediff Control Buffer only!$"
1457 ": Invalid op in ediff-check-version$"
1458 "^ediff-shrink-window-C can be used only for merging jobs$"
1459 "^Lost difference info on these directories$"
1460 "^This command is inapplicable in the present context$"
1461 "^This session group has no parent$"
1462 "^Can't hide active session, $"
1463 "^Ediff: something wrong--no multiple diffs buffer$"
1464 "^Can't make context diff for Session $"
1465 "^The patch buffer wasn't found$"
1467 "^This Ediff session is not part of a session group$"
1468 "^No active Ediff sessions or corrupted session registry$"
1469 "^No session info in this line$"
1470 "^`.*' is not an ordinary file$"
1471 "^Patch appears to have failed$"
1472 "^Recomputation of differences cancelled$"
1473 "^No fine differences in this mode$"
1474 "^Lost connection to ancestor buffer...sorry$"
1475 "^Not merging with ancestor$"
1476 "^Don't know how to toggle read-only in buffer "
1477 "Emacs is not running as a window application$"
1478 "^This command makes sense only when merging with an ancestor$"
1479 "^At end of the difference list$"
1480 "^At beginning of the difference list$"
1481 "^Nothing saved for diff .* in buffer "
1482 "^Buffer is out of sync for file "
1483 "^Buffer out of sync for file "
1484 "^Output from `diff' not found$"
1485 "^You forgot to specify a region in buffer "
1486 "^All right. Make up your mind and come back...$"
1487 "^Current buffer is not visiting any file$"
1488 "^Failed to retrieve revision: $"
1489 "^Can't determine display width.$"
1490 "^File `.*' does not exist or is not readable$"
1491 "^File `.*' is a directory$"
1492 "^Buffer .* doesn't exist$"
1493 "^Directories . and . are the same: "
1494 "^Directory merge aborted$"
1495 "^Merge of directory revisions aborted$"
1496 "^Buffer .* doesn't exist$"
1497 "^There is no file to merge$"
1498 "^Version control package .*.el not found. Use vc.el instead$"))
1499 (add-to-list 'debug-ignored-errors mess
))
1502 (require 'ediff-util
)
1504 (run-hooks 'ediff-load-hook
)
1507 ;;; Local Variables:
1508 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
1509 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
1510 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
1513 ;; arch-tag: 97c71396-db02-4f41-8b48-6a51c3348fcc
1514 ;;; ediff.el ends here