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-hookHooks run just after a meta-buffer controlling a session group is run.
ediff-before-session-group-setup-hooksHook run before Ediff arranges the window for group-level operations.
ediff-default-filtering-regexpDefault regular expression used as a filename filter in multifile comparisons.
ediff-dir-diffs-buffer-mapKeymap for buffer showing differences between directories.
ediff-meta-buffer-keymap-setup-hookHooks run just after setting up the ‘ediff-meta-buffer-map’.
ediff-meta-buffer-mapThe keymap for the meta buffer.
ediff-meta-mode-abbrev-tableAbbrev table for ‘ediff-meta-mode’.
ediff-meta-mode-hookHooks run just after setting up meta mode.
ediff-meta-mode-mapKeymap for ‘ediff-meta-mode’.
ediff-meta-mode-syntax-tableSyntax table for ‘ediff-meta-mode’.
ediff-meta-patchbuferBuffer holding the multi-file patch. Local to the meta buffer.
ediff-meta-truncate-filenamesIf non-nil, truncate long file names in the session group buffers.
ediff-monthsMonths’ associative array.
ediff-quit-session-group-hookHooks run just before exiting a session group.
ediff-registry-setup-hookHooks run just after the registry control panel is set up.
ediff-show-registry-hookHooks run just after the registry buffer is shown.
ediff-show-session-group-hookHooks run just after a session group buffer is shown.
ediff-verbose-help-enabledIf t, display redundant help in ‘ediff-directories’ and other meta buffers.

Defined functions (81)

ediff-add-slash-if-directory(DIR FILE)
ediff-append-custom-diff(SESSION SESSIONNUM)
ediff-bury-dir-diffs-buffer()
ediff-cleanup-meta-buffer(META-BUFFER)
ediff-collect-custom-diffs()
ediff-dir-diff-copy-file()
ediff-dispose-of-meta-buffer(BUF)
ediff-draw-dir-diffs(DIFF-LIST &optional BUF-NAME)
ediff-filegroup-action()
ediff-fill-leading-zero(NUM)
ediff-format-date(TIME)
ediff-get-directory-files-under-revision(JOBNAME REGEXP DIR1 &optional MERGE-AUTOSTORE-DIR)
ediff-get-file-eqstatus(ELT)
ediff-get-group-buffer(META-LIST)
ediff-get-group-comparison-func(META-LIST)
ediff-get-group-merge-autostore-dir(META-LIST)
ediff-get-group-objA(META-LIST)
ediff-get-group-objB(META-LIST)
ediff-get-group-objC(META-LIST)
ediff-get-group-regexp(META-LIST)
ediff-get-meta-info(BUF POINT &optional NOERROR)
ediff-get-meta-overlay-at-pos(POINT)
ediff-get-session-activity-marker(SESSION)
ediff-get-session-buffer(ELT)
ediff-get-session-number-at-pos(POINT &optional META-BUFFER)
ediff-get-session-objA(ELT)
ediff-get-session-objA-name(ELT)
ediff-get-session-objB(ELT)
ediff-get-session-objB-name(ELT)
ediff-get-session-objC(ELT)
ediff-get-session-objC-name(ELT)
ediff-get-session-status(ELT)
ediff-hide-marked-sessions(UNHIDE)
ediff-insert-dirs-in-meta-buffer(META-LIST)
ediff-insert-session-activity-marker-in-meta-buffer(SESSION)
ediff-insert-session-info-in-meta-buffer(SESSION-INFO SESSIONNUM)
ediff-insert-session-status-in-meta-buffer(SESSION)
ediff-intersect-directories(JOBNAME REGEXP DIR1 DIR2 &optional DIR3 MERGE-AUTOSTORE-DIR)
ediff-make-new-meta-list-element(OBJ1 OBJ2 OBJ3)
ediff-make-new-meta-list-header(REGEXP OBJA OBJB OBJC MERGE-AUTO-STORE-DIR COMPARISON-FUNC)
ediff-mark-for-hiding-at-pos(UNMARK)
ediff-mark-for-operation-at-pos(UNMARK)
ediff-mark-if-equal(FILEINFO1 FILEINFO2)
ediff-mark-session-for-hiding(INFO UNMARK)
ediff-mark-session-for-operation(INFO UNMARK)
ediff-meta-insert-file-info1(FILEINFO)
ediff-meta-mark-equal-files(&optional ACTION)
ediff-meta-mode()
ediff-meta-session-p(SESSION-INFO)
ediff-meta-show-patch()
ediff-next-meta-item(COUNT)
ediff-next-meta-overlay-start(POINT)
ediff-operate-on-marked-sessions(OPERATION)
ediff-patch-file-form-meta(FILE &optional STARTUP-HOOKS)
ediff-prepare-meta-buffer(ACTION-FUNC META-LIST META-BUFFER-NAME REDRAW-FUNCTION JOBNAME &optional STARTUP-HOOKS)
ediff-previous-meta-item(COUNT)
ediff-previous-meta-overlay-start(POINT)
ediff-problematic-session-p(SESSION)
ediff-quit-meta-buffer()
ediff-redraw-directory-group-buffer(META-LIST)
ediff-redraw-registry-buffer(&optional IGNORE)
ediff-registry-action()
ediff-replace-session-activity-marker-in-meta-buffer(POINT NEW-MARKER)
ediff-replace-session-status-in-meta-buffer(POINT NEW-STATUS)
ediff-safe-to-quit(META-BUFFER)
ediff-set-file-eqstatus(ELT VALUE)
ediff-set-meta-overlay(B E PROP &optional SESSION-NUMBER HIDDEN)
ediff-set-session-status(SESSION-INFO NEW-STATUS)
ediff-show-dir-diffs()
ediff-show-meta-buff-from-registry()
ediff-show-meta-buffer(&optional META-BUF SESSION-NUMBER)
ediff-show-registry()
ediff-toggle-filename-truncation()
ediff-toggle-verbose-help-meta-buffer()
ediff-unmark-all-for-hiding()
ediff-unmark-all-for-operation()
ediff-up-meta-hierarchy()
ediff-update-markers-in-dir-meta-buffer(META-LIST)
ediff-update-meta-buffer(META-BUF &optional MUST-REDRAW SESSION-NUMBER)
ediff-update-session-marker-in-dir-meta-buffer(SESSION-NUM)
eregistry()

Defined faces (0)