File: ediff-mult.el.html
Users are encouraged to add functionality to this file.
The present file contains all the infrastructure needed for that.
Generally, to implement a new multisession capability within Ediff, you need to tell it
1. How to display the session group buffer.
This function must indicate which Ediff sessions are active (+) and
which are finished (-).
See ediff-redraw-directory-group-buffer for an example.
In all likelihood, ediff-redraw-directory-group-buffer can be used
directly or after a small modification.
2. What action to take when the user clicks button 2 or types v,e, or
RET. See ediff-filegroup-action.
3. Provide a list of pairs or triples of file names (or buffers,
depending on the particular Ediff operation you want to invoke)
in the following format:
(HEADER (nil nil (obj1 nil) (obj2 nil) (obj3 nil))
(...) ...)
The function ediff-make-new-meta-list-element can be used to create
2nd and subsequent elements of that list (i.e., after the
description header). See ediff-make-new-meta-list-element for the
explanation of the two nil placeholders in such elements.
There is API for extracting the components of the members of the
above list. Search for API for ediff-meta-list for details.
HEADER must be a list of SIX elements (nil or string):
(regexp metaobj1 metaobj2 metaobj3 merge-save-buffer
comparison-function)
The function ediff-redraw-registry-buffer displays the
1st - 4th of these in the registry buffer.
For some jobs some of the members of the header might be nil.
The meaning of metaobj1, metaobj2, and metaobj3 depend on the job.
Typically these are directories where the files to be compared are
found.
Also, keep in mind that the function ediff-prepare-meta-buffer
(which see) prepends the session group buffer to the descriptor, so
the descriptor becomes 7-long.
Ediff expects that your function (in 2 above) will arrange to
replace this prepended nil (via setcar) with the actual ediff
control buffer associated with an appropriate Ediff session.
This is arranged through internal startup hooks that can be passed
to any of Ediff major entries (such as ediff-files, epatch, etc.).
See how this is done in ediff-filegroup-action.
Session descriptions are of the form
(nil nil (obj1 . nil) (obj2 . nil) (obj3 . nil))
which describe the objects relevant to the session.
Use ediff-make-new-meta-list-element to create these things.
Usually obj1/2/3 are names of files, but they may also be other
things for some jobs. For instance, obj3 is nil for jobs that
involve only two files. For patch jobs, obj2 and obj3 are markers
that specify the patch corresponding to the file
(whose name is obj1).
The nil's are placeholders, which are used internally by ediff.
4. Write a function that makes a call to ediff-prepare-meta-buffer
passing all this info.
You may be able to use ediff-directories-internal as a template.
5. If you intend to add several related pieces of functionality,
you may want to keep the function in 4 as an internal version
and then write several top-level interactive functions that call it
with different parameters.
See how ediff-directories, ediff-merge-directories, and
ediff-merge-directories-with-ancestor all use
ediff-directories-internal.
A useful addition here could be session groups selected by patterns
(which are different in each directory). For instance, one may want to
compare files of the form abc{something}.c to files old{something}.d
which may be in the same or different directories. Or, one may want to
compare all files of the form {something} to files of the form {something}~.
Implementing this requires writing a collating function, which should pair up appropriate files. It will also require a generalization of the functions that do the layout of the meta- and differences buffers and of ediff-filegroup-action.
Defined variables (18)
ediff-after-session-group-setup-hook | Hooks run just after a meta-buffer controlling a session group is run. |
ediff-before-session-group-setup-hooks | Hook run before Ediff arranges the window for group-level operations. |
ediff-default-filtering-regexp | Default regular expression used as a filename filter in multifile comparisons. |
ediff-dir-diffs-buffer-map | Keymap for buffer showing differences between directories. |
ediff-meta-buffer-keymap-setup-hook | Hooks run just after setting up the ‘ediff-meta-buffer-map’. |
ediff-meta-buffer-map | The keymap for the meta buffer. |
ediff-meta-mode-abbrev-table | Abbrev table for ‘ediff-meta-mode’. |
ediff-meta-mode-hook | Hooks run just after setting up meta mode. |
ediff-meta-mode-map | Keymap for ‘ediff-meta-mode’. |
ediff-meta-mode-syntax-table | Syntax table for ‘ediff-meta-mode’. |
ediff-meta-patchbufer | Buffer holding the multi-file patch. Local to the meta buffer. |
ediff-meta-truncate-filenames | If non-nil, truncate long file names in the session group buffers. |
ediff-months | Months’ associative array. |
ediff-quit-session-group-hook | Hooks run just before exiting a session group. |
ediff-registry-setup-hook | Hooks run just after the registry control panel is set up. |
ediff-show-registry-hook | Hooks run just after the registry buffer is shown. |
ediff-show-session-group-hook | Hooks run just after a session group buffer is shown. |
ediff-verbose-help-enabled | If t, display redundant help in ‘ediff-directories’ and other meta buffers. |