view doc/misc/ediff.texi @ 107863:594e81986a75

2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-insert-link): Find the link buffer on visible frames. (org-export-latex-default-packages-alist): hyperref must be loaded late. (org-open-file): More care with the new matching for file links. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-preprocess): Do not yet protect defined entities - these will be taken care of later. (org-export-latex-special-chars): Post-process entity replacement. (org-export-latex-fontify-headline): Do not yet protect defined entities - these will be taken care of later. (org-export-latex-tables, org-export-latex-links): Format the caption properly. * org-entities.el (org-entities-user): Fix typo. * org.el (org-prepare-agenda-buffers): Uniquify TODO keywords * org-entities.el (org-entities-user): Improve docstring. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-entities.el (org-macs): Require org-macs, to be sure that we have `declare-function' defined. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-classes): Update docstring. * org.el (org-format-latex-header): Add cookies to the header. (org-splice-latex-header): Implement placement according to cookies. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-publish.el (org-publish-aux-preprocess): Control case sensitivity. 2010-04-10 Bastien Guerry <bzg@altern.org> * org.el (org-splice-latex-header): Fix typo. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-make-header): Use `org-splice-latex-header' to build the header. (org-export-latex-classes): Update docstring. * org.el (org-splice-latex-header): New function. (org-create-formula-image): Use `org-splice-latex-header' to build the header. * org-gnus.el (org-gnus-follow-link): Handle nndoc backend. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-export-latex-packages-alist) (org-export-latex-default-packages-alist): Fix docstring to reflect the expected structure. * org-docbook.el (org-docbook-do-expand): Fix bug with variable names. (org-export-docbook-finalize-table): Make use of label for tables. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-attach.el (org-attach-commit): Split on newlines. * org.el (org-export-latex-default-packages-alist): Use list instead of cons for the entries. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-entities.el (org-entity-get-representation): Catch the case that there is not entry in the list. * org-mobile.el (org-mobile-use-encryption) (org-mobile-encryption-tempfile, org-mobile-encryption-password): New options. (org-mobile-check-setup): CHeck the encryption setup. (org-mobile-copy-agenda-files, org-mobile-sumo-agenda-command) (org-mobile-create-sumo-agenda): Use encryption code. (org-mobile-encrypt-and-move): New function. (org-mobile-encrypt-file, org-mobile-decrypt-file): New functions. (org-mobile-move-capture): Decrypt the capture file. * org.el (org-entities): Require the new file. (org-export-latex-default-packages-alist): New variable. (org-complete): Use new entity code for completion. (org-create-formula-image): Use the new packages variable. * org-latex.el (org-export-latex-classes): Remove the standard packages from the class headers. (org-export-latex-make-header): Use the new package variable. (org-export-latex-special-chars): Better regexp for entities, to support entity name that contain numbers. (org-export-latex-treat-backslash-char): Use the new entity code. * org-html.el (org-html-do-expand): Use the new entity code. * org-exp.el (org-export): Add the new export commands. (org-html-entities): Constant removed. (org-export-visible): Add the new export commands. * org-entities.el: New file. * org-docbook.el (org-docbook-do-expand): Use new entity code. * org-ascii.el (org-export-ascii-entities): New variable. (org-export-as-latin1, org-export-as-latin1-to-buffer) (org-export-as-utf8, org-export-as-utf8-to-buffer): New commands. (org-export-as-encoding): New function. (org-export-ascii-preprocess): Call `org-ascii-replace-entities'. (org-ascii-replace-entities): New function. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-html.el (org-html-level-start): Catch the case that target might be nil. 2010-04-10 Dan Davison <davison@stats.ox.ac.uk> * org.el (org-appearance): Change Customize group variable name from org-font-lock to org-appearance, and change tag from "Org Font Lock" to "Org Appearance" (org-odd-levels-only): Change Customize group variable name (org-level-color-stars-only): Change Customize group variable name (org-hide-leading-stars): Change Customize group variable name (org-hidden-keywords): Change Customize group variable name (org-fontify-done-headline): Change Customize group variable name (org-fontify-emphasized-text): Change Customize group variable name (org-fontify-whole-heading-line): Change Customize group variable name (org-highlight-latex-fragments-and-specials): Change Customize group variable name (org-hide-emphasis-markers): Change Customize group variable name (org-emphasis-alist): Change Customize group variable name (org-emphasis-regexp-components): Change Customize group variable name (org-modules): Remove mention of org-R * org-faces.el (org-faces): Change Customize group variable name 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-diary-last-run-time): New variable. (org-diary): prepare agenda buffers only if last call was some time ago. * org-html.el (org-export-html-preprocess): Replace \ref macros with a link. (org-format-org-table-html): Add the label as an anchor. * org-docbook.el (org-export-docbook-format-image): Do some formatting on captions. * org-latex.el (org-export-latex-tables, org-export-latex-links): Do some formatting on captions. * org-html.el (org-export-html-format-image) (org-format-org-table-html): Do some formatting on captions. 2010-04-10 Dan Davison <davison@stats.ox.ac.uk> * org.el (org-hidden-keywords): New customizable variable. This is a list of symbols specifying which of the special keywords #+DATE, #+AUTHOR, #+EMAIL and #+TITLE should be hidden by font lock. (org-fontify-meta-lines-and-blocks): Changes to font-lock code implementing new faces and hiding behaviour. * org-faces.el (org-document-title): New face for #+TITLE lines (org-document-info): New face for #+DATE, #+AUTHOR, #+EMAIL lines (org-document-info-keyword): New face for #+DATE, #+AUTHOR, #+EMAIL keywords 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-publish.el (org-publish-sanitize-plist): New function to rename "index" properties to "sitemap". Do this renaming globally. (org-publish-with-aux-preprocess-maybe): New macro. (org-publish-org-to-pdf, org-publish-org-to-html): Use the new macro. (org-publish-aux-preprocess) (org-publish-index-generate-theindex.inc): New function. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-align): Interpret <N> at fixed width, not as maximum width. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-author-info, org-export-email-info): Fix docstrings. * org-beamer.el (org-beamer-select-environment): Renamed from `org-beamer-set-environment-tag'. Improve docstring. * org-freemind.el (org-freemind-write-mm-buffer): Fix another problem with odd levels. * org-ascii.el (org-export-as-ascii): Export email only if the author wants it. * org-docbook.el (org-export-as-docbook): Export email only if the author wants it. * org-html.el (org-export-as-html): Export email only if the author wants it. * org-exp.el (org-export-email-info): New option. (org-export-plist-vars): Add entry for `org-export-email'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-goto-line): Fix typo. 2010-04-10 Mikael Fornius <mfo@abc.se> * org.el (org-agenda-files): Typo. (org-read-agenda-file-list): Add optional argument to help `org-store-new-agenda-file-list' to remember un-expanded file names. Expand file names relative to `org-directory'. (org-store-new-agenda-file-list): Keep un-expanded file names when saving, if available. (org-agenda-files): Update documentation. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-ascii.el (org-export-as-ascii): Catch the case of exporting a buffer with no file name attached. * org.el (org-log-refile): New option. (org-log-note-headings): Add a heading for refiling. (org-startup-options): Add keywords for logging of the refile action. (org-refile): Add logging action. (org-add-log-note): Allow for refiling action. * org-agenda.el (org-agenda-bulk-action): Make sure `org-log-refile' is not `note' during a bulk action. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-map-dblocks): Use save-excursion to remember the position. * org-attach.el (org-attach-commit): Remove dependence on xargs. (org-attach-delete-one): Commit after deleting a file. * org-latex.el (org-export-latex-fontify): Do not mistake table.el borders for strike-through emphasis. * org-freemind.el (org-freemind-write-mm-buffer): Simplify the handling of odd levels. * org-agenda.el (org-agenda-todo-ignore-deadlines): Document `past' and `future' values. (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item): Handle `past' and `future' values. * org.el (org-read-agenda-file-list): Interpret file names relative to org-directory and allow environment variables and "~". * org-latex.el (org-export-latex-special-chars): Allow a parenthesis before an exponent or subscript. 2010-04-10 Dan Davison <davison@stats.ox.ac.uk> * org-src.el (org-edit-src-exit): When returning from code edit buffer, if code block is hidden, leave point at start of #+begin_src line 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-insert-heading): Do not remove all spaces if the headline is empty. * org-indent.el (org-indent): Fix group name. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-goto-column): Fix forcing a non-existing column. (org-table-get, org-table-put, org-table-goto-line) (org-table-current-line): New functions. 2010-04-10 Jan Bcker <jan.boecker@jboecker.de> * org.el (org-open-file): Allow regular expressions in org-file-apps to capture link parameters using groups. In a command string to be executed, the parameters can be referenced using %1, %2, etc. Lisp forms can access them using (match-string n link). (org-apps-regexp-alist): Adopt the created regexp, as this is now matched against a file: link instead of the file name. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-crypt.el (org-reveal-start-hook): Add a decryption function to this hook. (org-decrypt-entries, org-encrypt-entries, org-decrypt-entry): Add docstrings. * org.el (org-point-at-end-of-empty-headline) (org-level-increment, org-get-previous-line-level): New function. (org-cycle-level): Rewritten to be independent of when this function is called. (org-in-regexps-block-p): New function. (org-reveal-start-hook): New hook. (org-reveal): Run new hook. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-keywords): Start a new paragraph after time keywords, do not add "\newline". * org-html.el (org-export-as-html): Avoid double # in href. * org.el (org-refile-get-location): Catch an invalid target specification. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file): Make sure the behavior regarding to extracting time is consistent. 2010-04-10 Stephen Eglen <stephen@gnu.org> * org-agenda.el (org-agenda-insert-diary-extract-time): New variable. (org-agenda-add-entry-to-org-agenda-diary-file): Use this new variable rather than `org-agenda-search-headline-for-time'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-list.el (org-fix-bullet-type): Improve cursor positioning. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-adaptive-fill-regexp-backup): New variable. (org-set-autofill-regexps): Store a backup of `adaptive-fill-regexp'. (org-adaptive-fill-function): Fix filling of comments and ordered lists. If there is no other match, till try adaptive fill. 2010-04-10 John Wiegley <jwiegley@gmail.com> * org-agenda.el (org-agenda-include-deadlines): Added new customization variable to determine whether unscheduled tasks should appear in the agenda solely because of their deadline. Default to true, which was the previous behavior (it just wasn't configurable). (org-agenda-mode-map, org-agenda-view-mode-dispatch): Bind ! in the agenda to show/hide deadline tasks. (org-agenda-menu): Added menu option for show/hide deadlines. (org-agenda-list): Make the agenda list sensitive to the value of `org-agenda-include-deadlines'. (org-agenda-toggle-deadlines): New function to toggle the value of `org-agenda-include-deadlines' and repaint the modeline indicators. (org-agenda-set-mode-name): Show "Deadlines" in the agenda modeline if deadline tasks are being displayed. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-eval-formula): Replace $# and @# by current column and row number. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-set-property, org-delete-property): Go back to prompting for the property. * org-latex.el (org-export-latex-make-header): Fully process author line. (org-export-latex-fontify-headline): Allow several arguments, not just one. (org-export-latex-fix-inputenc): Catch the error when `latexenc-coding-system-to-inputenc' is not defined. * org-agenda.el (org-agenda-skip-if-todo): New function. (org-agenda-skip-if): Add conditions for TODO keywords. (org-agenda-skip-if): Document the new todo conditions. 2010-04-10 Mikael Fornius <mfo@abc.se> * org.el (org-at-property-p): Check if we are inside a property drawer not just any drawer. (org-set-property, org-delete-property): When cursor is on a property key value pair do not prompt for property name instead use name at cursor. (org-ctrl-c-ctrl-c): Still do org-property-action when cursor is on the first line of a property drawer. (org-property-end-re): Spell check. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-attach-captions-and-attributes): Add the properties to the entire table, in case the first line is removed. * org-archive.el (org-archive-reversed-order): New option. (org-archive-subtree, org-archive-to-archive-sibling): Use the new option `org-archive-reversed-order'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-entry-types): New variable. (org-agenda-list): Use `org-agenda-entry-types'. (org-agenda-custom-commands-local-options): Support for setting `org-agenda-entry-types' as an option. (org-diary): Shift some documentation from here to the variable `org-agenda-entry-types'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-make-header): Apply macros in author field. * org-clock.el (org-clocking-buffer, org-clocking-p): New function. (org-clock-select-task, org-clock-notify-once-if-expired) (org-clock-in, org-clock-out, org-clock-cancel, org-clock-goto) (org-clock-out-if-current, org-clock-save): Use the new functions. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-docbook.el (org-export-as-docbook): Remove unnecessary newline. (org-export-as-docbook): Remove unnecessary newline. (org-export-as-docbook): Fix problem with double footnote reference in one place. * org-exp.el (org-export-format-source-code-or-example): Remove unnecessary newline. * org.el (org-deadline, org-schedule): Allow rescheduling entries with repeaters. * org-table.el (org-table-convert-refs-to-rc): Better way to catch function calls that look like references. * org.el (org-open-at-point): Get link abbreviations from reference buffer. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-convert-refs-to-rc): Do not read arctan2 as a reference. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-link-unescape): Solve issue with lower-case escapes. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-classes): Add \usepackage{latexsym} to all classes. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-html.el (org-export-as-html): Do not allow protected lines into the table of contents. * org-latex.el (org-export-latex-special-chars): Find subsequent occurrences of special characters. (org-export-latex-tables): Do not convert table-like stuff that is protected. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-list.el (org-toggle-checkbox): No errors when updating checkbox count fails because there is no heading. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-report-include-clocking-task): New option. (org-clock-sum): Add the current clocking task. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-cycle): Print a message when in a table.el table. (org-edit-special): Recognize the table.el context. (org-ctrl-c-ctrl-c): Print a message when in a table.el table. * org-src.el (org-at-table.el-p): Declare. (org-edit-src-code): Handle a special case for table.el editing. (org-edit-src-find-region-and-lang): Recognize the table.el context. * org-latex.el (org-export-latex-tables): Convert table.el tables. (org-export-latex-convert-table.el-table): New function. * org-html.el (org-html-expand): Fix table.el export. * org-latex.el (org-export-latex-preprocess): Protect footnotes in headings. * org-id.el (org-id-find-id-file): Fix bug when there is no hash table for the id locations. * org.el (org-read-date-analyze): Match American-style dates, like 5/30 or 5/13/7. Make sure cal-iso.el is loaded. Don't force he current year when reading ISO and American dates. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-face-from-face-or-color): New function. (org-get-todo-face, org-font-lock-add-priority-faces) (org-get-tag-face): Use `org-face-from-face-or-color'. * org-faces.el (org-todo-keyword-faces, org-priority-faces): Allow simple colors as values. (org-faces-easy-properties): New option. * org-agenda.el (org-agenda-set-mode-name): Show if the agenda is restricted, as an agenda mode. (org-agenda-fontify-priorities): Allow simple colors as values. 2010-04-10 Bastien Guerry <bzg@altern.org> * org-timer.el (org-timer-current-timer): Renamed from `org-timer-last-timer'. (org-timer-timer1, org-timer-timer2, org-timer-timer3): Removed. (org-timer-cancel-timer, org-timer-show-remaining-time) (org-timer-set-timer): Update to use only one timer. * org.el (org-set-property): Remove useless space in the prompt. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-html.el (org-export-html-style-default): Add a default style for textareas. * org-exp.el (org-export-format-source-code-or-example): Fix textarea tag. 2010-04-10 Bastien Guerry <bzg@altern.org> * org-clock.el (org-clock-current-task): New variable to store last clocked in task. (org-clock-set-current, org-clock-delete-current): New functions. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-remember.el (org-remember-apply-template): Extend comment. (org-remember-handler): Implement clock sibling filing. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-publish.el (org-publish-all, org-publish-current-file) (org-publish-current-project): When called with prefix argument FORCE, also rebuild the validation file list. * org-latex.el (org-export-latex-preprocess): Protect footnotes in section headings. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-html.el (org-export-as-html-and-open): Kill product buffer if the user wants that. * org-latex.el (org-export-as-pdf-and-open): Kill product buffer if the user wants that. * org-exp.el (org-export-kill-product-buffer-when-displayed): New option. * org-agenda.el (org-batch-agenda-csv): Use the time property instead of the `time-of-day' property. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-timer.el (org-timer-start-hook, org-timer-stop-hook) (org-timer-pause-hook, org-timer-set-hook) (org-timer-cancel-hook): New hooks. (org-timer-start): Run `org-timer-start-hook'. (org-timer-pause-or-continue): Run `org-timer-pause-hook'. (org-timer-stop): Run `org-timer-stop-hook'. (org-timer-cancel-timers): Run `org-timer-cancel-hook'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-reveal): Double prefix arg shows the subtree of the parent. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-search-view): Fix bug with searching full words in headlines in search view. (org-agenda-skip-deadline-prewarning-if-scheduled): New option. (org-agenda-get-deadlines): Suppress pre-warning if the entry is scheduled (if the user configures it so. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-hide-archived-subtrees): Don't jump to end of subtree if the match was not in a headline. (org-inside-latex-macro-p): Allow more complex arguments. (org-emphasize): Protect against use at end of buffer. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-align-tags): Avoid side effects on text properties. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-todo-ignore-scheduled): More allowed values. (org-agenda-todo-ignore-scheduled) (org-agenda-todo-ignore-deadlines): More control with different allowed values. (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item): Honor the new option settings. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-get-location): Make sure the selection buffer is shown in the current frame. * org-ascii.el (org-export-ascii-table-widen-columns): New option. (org-export-ascii-preprocess): Realign tables to remove narrowing if `org-export-ascii-table-widen-columns' is set. * org-table.el (org-table-do-narrow): New variable. (org-table-align): Narrow only if `org-table-do-narrow' is t. * org.el (org-deadline, org-schedule): Allow updating if the relevant time stamp does not have a repeater, i.e. do not require that no time stamp has a repeater. * org-agenda.el (org-agenda-align-tags): Don't add a face to the new white space before the tags. * org-latex.el (org-export-as-latex): Do nit require the buffer to be visiting a file when only exporting to a buffer or string. (org-export-latex-fix-inputenc): Only save the buffer is there is a file name attached to it. 2010-04-10 Dan Davison <davison@stats.ox.ac.uk> * org-src.el (org-edit-src-exit): Widen before exiting edit buffers 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-fontify-meta-lines-and-blocks): Honor `org-fontify-quote-and-verse-blocks'. * org-faces.el (org-fontify-quote-and-verse-blocks): New option. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-open-at-point): Also check for text property org-linked-text before offering collected links. 2010-04-10 Stephen Eglen <stephen@gnu.org> * org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file): Optionally extract time specification from text and add to the timestamp. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-html-entities): Fix typo. * org-latex.el (org-export-latex-make-header): Use \providecommand to make sure the \alert macro is defined. * org.el (org-format-latex-signal-error) (org-create-formula-image): Use `org-format-latex-signal-error'. 2010-04-10 Stephen Eglen <stephen@gnu.org> * org.el (org-store-link): For dired buffers, use default-directory as link name if dired-get-filename returns nil. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-concatenate-multiline-links): The for protectedness at beginning of match. * org-latex.el (org-export-latex-fix-inputenc): Never leave the AUTO as a coding system, instead default to utf8. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-block-todo-from-children-or-siblings-or-parent) (org-block-todo-from-checkboxes): Respect the local variable value when deciding if blocking should be active. * org-latex.el (org-export-latex-make-header): Define the align macro if it is not yet defined. * org-agenda.el (org-agenda-insert-diary-make-new-entry): Call `org-insert-heading' with the INVISIBLE-OK argument. * org-mac-message.el (org-mac-message-insert-flagged): Call `org-insert-heading' with the INVISIBLE-OK argument. * org.el (org-insert-heading): New argument INVISIBLE-OK. * org-agenda.el (org-agenda-view-mode-dispatch): Improve the prompt message. * org-html.el (org-html-level-start): Use the `html-container-class' text property to set an additional class for an outline container. * org-exp.el (org-export-remember-html-container-classes): New function. (org-export-preprocess-string): Call `org-export-remember-html-container-classes'. * org.el (org-cycle): Mention level cycling in the docstring. (org-default-properties): Add new property HTML_CONTAINER_CLASS. * org-remember.el (org-remember-apply-template): Do file insertion first. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-habit.el (org-habit-insert-consistency-graphs): Fix a problem with mis-aligned graphs when showing habits. 2010-04-10 Mikael Fornius <mfo@abc.se> * org.el (org-assign-fast-keys): Prefer keys used in keyword name when assigning. Begin using numerical characters when all in name is used up. This is to spare alphanumeric characters for better match with other keywords. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-preprocess-hook): Improve documentation. * org-latex.el (org-export-latex-preprocess): More consistent conversion and protection of the words LaTeX and TeX. (org-export-latex-fontify-headline, org-export-latex-preprocess): Allow angle brackets in commands, for beamer. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-in): Improve the look of the clock line by formatting links. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-classes): Use AUTO as the place holder string for the coding system. And improve the documentation. (org-export-latex-fix-inputenc): Only modify the coding system if it is given by the placeholder AUTO. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-task-overrun-text): New option. (org-task-overrun, org-clock-update-period): New variables. (org-clock-get-clock-string, org-clock-update-mode-line): Mark overrun clock. (org-clock-notify-once-if-expired): Check if clock is overrun. * org-faces.el: New face `org-mode-line-clock-overrun'. 2010-04-10 Jan Bcker <jan.boecker@jboecker.de> * org.el (org-narrow-to-subtree): Position the end of the narrowed region before the line with the next heading, to prevent the user from prepending text to the next headline. 2010-04-10 Stephen Eglen <stephen@gnu.org> * org-agenda.el (org-get-time-of-day): Use org-agenda-time-leading-zero to allow leading zero (rather than space) for times. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-diary-entry-in-org-file): Make sure org-datetree.el is loaded. * org-datetree.el: autoload `org-datetree-find-day-create' * org-latex.el (org-export-latex-hyperref-format): New option. (org-export-latex-links): Use `org-export-latex-hyperref-format'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-ctags.el (org-ctags-enable): Change order of functions. (org-ctags-create-tags): Add wildcard to file name expansion. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-entry-properties): Fix some important bugs. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-link-unescape, org-link-escape): Only use hexlify if the table is not explicitly given. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-out-when-done): Allow a list of keywords as value. (org-clock-out-if-current): Work with the new list value of `org-clock-out-when-done'. (org-clock-out, org-clock-out-if-current): Avoid circular logic between clocking out and state changes. * org-ctags.el (org-ctags-path-to-ctags): Better system-type test. * org-latex.el (org-export-latex-treat-backslash-char): Do not by accident protect a character that is before a backslash. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-diary-class): Use `org-order-calendar-date-args'. * org.el (org-order-calendar-date-args): New function. * org-exp.el (org-export-target-internal-links): Check for protectedness after the first bracket. * org.el (org-entry-properties): Don't match wrong-case TODO keywords. * org-agenda.el (org-agenda-schedule, org-agenda-deadline): Document that ARG is passed through to remove the date. (org-agenda-bulk-action): Accept prefix arg and pass it on. Do not read a date when the user has given a `C-u' prefix. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-fix-displayed-tags): Fix bug when all tags are hidden. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-fix-inputenc): New function. (org-export-latex-inputenc-alist): New option. * org-exp.el (org-export): New key SPC to publish enclosing subtree. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-indent.el (org-indent-add-properties): Catch case when there is no headline in the buffer. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-html-entities): Add checkmark symbol. * org-ascii.el (org-export-ascii-preprocess): Protect targets in verbatim code for ASCII export. * org.el (org-update-statistics-cookies): Also see checkboxes in ordered lists. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-view-mode-dispatch): Define the `L' key. * org-beamer.el (org-beamer-amend-header): Change the location where `org-beamer-header-extra' is inserted. * org.el (org-compute-latex-and-specials-regexp): Don't do BIND just for computing this regexp. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-beamer.el (org-beamer-frame-default-options): New option. (org-beamer-sectioning): Use default options if the user does not have defined any. (org-beamer-fix-toc): Put a frame around the table of contents. * org-exp.el (org-export-remove-comment-blocks-and-subtrees): Make sure case-folding works well when processing comment stuff. * org-latex.el (org-export-latex-after-save-hook): New hook. (org-export-as-latex): Run the new hook. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-beamer.el (org-beamer-environments-default): Add the note environments. (org-beamer-after-initial-vars): Allow several BEAMER_HEADER_EXTRA lines and collect and combine the content. (org-beamer-after-initial-vars): Check for note tags and make sure they will be seen like a property. * org.el (org-offer-links-in-entry): Fix bug when there is a single link. * org-exp.el (org-export): Make sure the mark is activated, also when `transient-mark-mode' is off. * org-agenda.el (org-agenda-search-view-always-boolean): New option. (org-agenda-search-view-search-words-only): Obsolete variable, is now an alias for `org-agenda-search-view-always-boolean'. (org-agenda-search-view-force-full-words): New option. (org-search-view): Improve docstring, and implement a better logic for Boolean and phrase searches. (org-agenda-last-search-view-search-was-boolean): New variable. (org-agenda-manipulate-query): Consider the type of the last search when modifying the search string. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-as-latex): Do the first letbind in the right moment. * org-agenda.el (org-get-entries-from-diary): Add the new face to these entries. * org-faces.el (org-agenda-diary): New face. * org.el (org-make-link-regexps): Allow regexp-special characters in link types. (org-open-file): When in-emacs is `system', also force system opening, like when the value was `(16)'. (org-update-statistics-cookies): Handle entries without children. * org-exp.el (org-export-preprocess-before-normalizing-links-hook): New hook. (org-export-preprocess-string): Run the new hook. * org.el (org-offer-links-in-entry): Make RET open all links. * org-html.el (org-export-as-html): Remove any leftover display properties in the html file. * org-wl.el (org-wl-store-link): Work-around for format bug with text properties. * org-habit.el (org-habit-insert-consistency-graphs): Turn off invisibility while adding the graphs. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-remember.el (org-select-remember-template): Use C letter to customize remember templates. * org-agenda.el (org-agenda-bulk-mark, org-agenda-bulk-unmark): Move cursor to next visible line. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-beamer.el (org-beamer-sectioning): Leave columns environment by specifying 0 or 1 for column width. (org-beamer-column-widths): Make 0 stand for 0.0. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-mark-radio-links): Don't match inside <<target>>. * org.el (org-format-latex-header-extra): New variable. (org-format-latex): Set org-format-latex-header-extra from in-buffer stuff. (org-format-latex): Add org-format-latex-header-extra to the variables on which image creation depends. (org-create-formula-image): Add the header stuff from in-buffer settings. (org-read-date-analyze): Base the analysis for future preference on NOW, not on the default date. * org-inlinetask.el (org-inlinetask-export-handler): Add CSS class for TODO keyword in inline tasks. * org.el (org-log-note-headings): New headings for removing deadline or scheduling date. (org-deadline, org-schedule): Arrange for logging when removing a date. (org-add-log-note): Handle deadline and scheduling removal. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-visible): Add LaTeX/pdf export. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-diary-class): New function. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-preprocess): Do process the text of a radio target. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-entry-properties): Add TIMESTAMP properties back in. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-all-time-keywords): New variable. (org-set-regexps-and-options): Set `org-all-time-keywords'. (org-entry-blocked-p): New function. (org-special-properties): Add BLOCKED as a new special property. (org-entry-properties): New optional argument SPECIFIC, only parse for this property when it is specified. (org-entry-get): Pass a SPECIFIC argument to `org-entry-properties'. * org-latex.el (org-export-as-latex): Preprocess TEXT as well. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-tables): No forced line end if there is no caption. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-html-entities): Add Euro symbols from Marvosym package. * org-latex.el (org-export-latex-tables): Only add a caption when macro in in longtable environments if one has been defined. * org-html.el (org-export-as-html): Only take title from buffer if not exporting body-only. * org-latex.el (org-export-latex-preprocess): Better version of the regular expression for protecting LaTeX macros. (org-export-latex-preprocess): Start searching for macros to protect from beginning of buffer. * org-exp.el (org-export-target-internal-links): Check for protectedness earlier in the string. * org-agenda.el (org-agenda-highlight-todo): Match TODO keywords case sensitively. * org-id.el (org-id-store-link): Match TODO keywords case sensitively. * org.el (org-heading-components, org-get-outline-path) (org-display-outline-path): Match TODO keywords case sensitively. * org-latex.el (org-export-as-latex): Ignore read-only properties. * org-exp.el (org-export-preprocess-string): Remove any `read-only' properties. * org-agenda.el (org-agenda-inactive-leader): New option. (org-agenda-get-timestamps): Use `org-agenda-inactive-leader'. (org-tags-view): Prompt for matcher if MATCH is an empty string. (org-todo-list): Prompt for matcher if ARG is an empty string. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-open-link-functions): New hook. (org-open-at-point): Run `org-open-link-functions'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-date-prompt): Allow inactive time stamps as well. * org.el (org-inhibit-startup-visibility-stuff): New variable. (org-mode): Don't do startup visibility if inhibited. (org-outline-overlay-data, org-set-outline-overlay-data): New functions. (org-save-outline-visibility): New macro. (org-log-note-headings): Document that one should not change the `state' note format. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-make-link-regexps): Capture link path into a group. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-beamer.el (org-beamer-after-initial-vars): Do not overwrite the options plist. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-startup-with-beamer-mode): New option. (org-property-changed-functions) (org-property-allowed-value-functions): New hooks. (org-entry-put, org-property-get-allowed-values): Run the new hooks. (org-property-next-allowed-value): Run the new hooks. * org-exp.el (org-export-select-backend-specific-text): Add the special beamer tags. * org-beamer.el (org-export-preprocess-before-selecting-backend-code-hook): New file. * org-latex.el (org-export-latex-after-initial-vars-hook): New hook. (org-export-as-latex): Run `org-export-latex-after-initial-vars-hook'. (org-export-latex-format-toc-function) (org-export-latex-make-header): Call `org-export-latex-format-toc-function'. * org.el (org-fill-template): Make template searches case sensitive. * org-exp.el (org-export): Use "1" as a sign to export only the subtree. * org-colview-xemacs.el (org-columns-edit-value): Use org-unrestricted property. * org-colview.el (org-columns-edit-value): Use org-unrestricted property. * org.el (org-compute-property-at-point): Set org-unrestricted text property if the list contains ":ETC". (org-insert-property-drawer): Use org-unrestricted property. * org-exp.el (org-export-preprocess-before-selecting-backend-code-hook): New hook. (org-export-preprocess-string): Run `org-export-preprocess-before-selecting-backend-code-hook'. * org-xoxo.el (org-export-as-xoxo): Run `org-export-first-hook'. * org-latex.el (org-export-region-as-latex): Run `org-export-first-hook'. * org-html.el (org-export-as-html): Run `org-export-first-hook'. * org-docbook.el (org-export-as-docbook): Run `org-export-first-hook'. * org-ascii.el (org-export-as-ascii): Run `org-export-first-hook'. * org-exp.el (org-export-first-hook): New hook. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-list.el (org-previous-item): Exit at the beginning of the buffer. * org-id.el (org-id-locations-save): Only write the id locations if any are defined. * org-archive.el (org-archive-all-done): Make this work in a file with org-odd-levels-only set. * org.el (org-get-refile-targets): Catch the case when a buffer has no file. * org-latex.el (org-export-as-latex): Cleanup forced line ends where they are not needed. (org-export-latex-subcontent): Remove unnecessary newlines. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-make-header): Remove \obeylines. (org-export-latex-fontify): Fix regexp bug that takes special care of protecting the right boundary characters in emphasis matches. (org-export-latex-preprocess): Allow multiple arguments to latex macros. * org.el (org-make-link-regexps): Use John Gruber's regexp for urls. * org-macs.el (org-re): Interpret :punct: in regexps. * org-exp.el (org-export-replace-src-segments-and-examples): Also take the final newline after the END line. * org.el (org-clean-visibility-after-subtree-move): Only fix entries that are not entirely invisible already. (org-insert-link): Respect org-link-file-path-type for "docview:" links in addition to "file:" links. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-format-source-code-or-example): Avoid additional extra white lines in LaTeX. * org-list.el (org-list-parse-list): Leave empty lines after the list, don't consider them as part of the list. * org-mobile.el (org-mobile-sumo-agenda-command): Allow tagstodo searches. * org-clock.el (org-clock-select-task): Convert integer to character for XEmacs. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-resolve): Make reading a char XEmacs compatible. 2010-04-10 Tassilo Horn <tassilo@member.fsf.org> * org.el (org-complete-tags-always-offer-all-agenda-tags): New variable. (org-set-tags): Use it. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-list.el (org-empty-line-terminates-plain-lists): Update docstring. * org.el (org-format-latex): Fix link creation for processed latex snippets. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-footnote.el (org-footnote-normalize): Protect replacement text. * org.el (org-inside-latex-macro-p): Save match data. 2010-04-10 Jan Bcker <jan.boecker@jboecker.de> * org-docview.el: New file. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-class-options): New variable. (org-export-latex-set-initial-vars): Use the class options. * org.el (org-forward-same-level): Stop at headings that start with an invisible character. (org-additional-option-like-keywords): Add LaTeX_CLASS_OPTIONS. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-footnote.el (org-footnote-normalize): Don't take optional arguments in LaTeX macros as footnotes. * org.el (org-inside-latex-macro-p): New function. * org-latex.el (org-latex-to-pdf-process): Change customization group to `org-export-pdf'. * org-agenda.el (org-agenda-get-blocks): Look at time string also on days after the first one. * org.el (org-insert-heading): Also check for item before assuming before-first-heading condition. * org-latex.el (org-latex-to-pdf-process): Fix typo in group tag. (org-export-pdf-logfiles): New option. (org-export-as-pdf): Use `org-export-pdf-logfiles'. (org-export-pdf-logfiles): Fix customization type. * org.el (org-insert-link): Improve error message when there is no default link to select with RET. * org-agenda.el (org-agenda-filter-by-tag): Use char argument from parameter list. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-parse-global) (org-export-latex-parse-content) (org-export-latex-parse-subcontent): Use `org-re-search-forward-unprotected'. (org-export-as-pdf): Remove log files produced by XeTeX. * org-macs.el (org-re-search-forward-unprotected): New function. 2010-04-10 James TD Smith <ahktenzero@mohorovi.cc> * org-colview.el (org-agenda-colview-summarize): Sort out some confusion between properties and titles, which resulted in agenda summaries not working if a title was set for a column. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-mobile.el (org-mobile-agendas): New option. (org-mobile-sumo-agenda-command): Select the right agendas. * org-latex.el (org-export-latex-format-image): Preserve the original-indentation property. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-insert-selection-line): Catch error when an old tasks no longer exists. * org-latex.el (org-export-as-pdf): Remove also the .idx file. (org-export-as-pdf): Don't remove the old PDF file before making the new one. * org-mouse.el (org-mouse-end-headline, org-mouse-insert-item) (org-mouse-context-menu): Use `org-looking-back'. * org.el (org-cycle-level): Use `org-looking-back'. * org-list.el (org-cycle-item-indentation): Use `org-looking-back'. * org-compat.el (org-looking-back): New function. * org.el (org-insert-heading): Catch before-first-headline when inserting a headline. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-format-image): Indent figure environment, so that it does not interrupt plain list. * org.el (org-open-at-point): Allow long link descriptions. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-html.el (org-export-as-html): Remove empty lines at the beginning of the exported text. 2010-04-15 Carsten Dominik <carsten.dominik@gmail.com> * org.texi (LaTeX and PDF export): Add a footnote about xetex. (LaTeX/PDF export commands): Section renamed and moved. (Sectioning structure): Update. (References): New use case for field coordinates. (The export dispatcher): Renamed from ASCII export. (Setting up the staging area): Document the availability of encryption for MobileOrg. (Images and tables): Document how to reference labels. (Index entries): New section. (Generating an index): New section. (Column width and alignment): Document that <N> now means a fixed width, not a maximum width. (Publishing options): Document the :email option. (Beamer class export): Fix bug in the BEAMER example. (Refiling notes): Document refile logging. (In-buffer settings): Document refile logging keywords. (Drawers): Document `C-c C-z' command. (Agenda commands): Mention the alternative key `C-c C-z'. (Special properties): Document the BLOCKED property. (The spreadsheet): Mention the formula editor. (References): Document field coordinates. (Publishing action): Correct the documentation for the publishing function. (The date/time prompt): Document that we accept dates like month/day/year. (Cooperation): Document the changes in table.el support. (Faces for TODO keywords, Faces for TODO keywords) (Priorities): Document the easy colors. (Visibility cycling): Document the new double prefix arg for `org-reveal'. (Cooperation): Remember.el is part of Emacs. (Clean view): Mention that `wrap-prefix' is also set by org-indent-mode. (Agenda commands): Add information about prefix args to scheduling and deadline commands. (Search view): Point to the docstring of `org-search-view' for more details. (Agenda commands): Document that `>' prompts for a date. (Setting tags): Document variable org-complete-tags-always-offer-all-agenda-tags. (Column attributes): Cross-reference special properties.
author Carsten Dominik <carsten.dominik@gmail.com>
date Thu, 15 Apr 2010 12:11:52 +0200
parents 1d1d5d9bd884
children 50478146a2e1 376148b31b5e
line wrap: on
line source

\input texinfo                  @c -*-texinfo-*-
@c documentation for Ediff
@c Written by Michael Kifer

@comment %**start of header (This is for running Texinfo on a region.)

@comment Using ediff.info instead of ediff in setfilename breaks DOS.
@comment @setfilename ediff
@comment @setfilename ediff.info
@setfilename ../../info/ediff

@settitle Ediff User's Manual
@synindex vr cp
@synindex fn cp
@synindex pg cp
@synindex ky cp

@iftex
@finalout
@end iftex
@c      @smallbook
@comment %**end of header (This is for running Texinfo on a region.)

@copying
This file documents Ediff, a comprehensive visual interface to Unix diff
and patch utilities.

Copyright @copyright{} 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.

@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
and with the Back-Cover Texts as in (a) below.  A copy of the license
is included in the section entitled ``GNU Free Documentation License''.

(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
modify this GNU manual.  Buying copies from the FSF supports it in
developing GNU and promoting software freedom.''
@end quotation
@end copying

@dircategory Emacs
@direntry
* Ediff: (ediff).       A visual interface for comparing and merging programs.
@end direntry

@titlepage
@title Ediff User's Manual
@sp 4
@subtitle Ediff version 2.81.2
@sp 1
@subtitle November 2008
@sp 5
@author Michael Kifer
@page

@vskip 0pt plus 1filll
@insertcopying
@end titlepage

@contents

@node Top, Introduction, (dir), (dir)

@insertcopying

@menu
* Introduction::                About Ediff.
* Major Entry Points::          How to use Ediff.
* Session Commands::            Ediff commands used within a session.
* Registry of Ediff Sessions::  Keeping track of multiple Ediff sessions.
* Session Groups::              Comparing and merging directories.
* Remote and Compressed Files::  You may want to know about this.
* Customization::               How to make Ediff work the way YOU want.
* Credits::                     Thanks to those who helped.
* GNU Free Documentation License:: The license for this documentation.
* Index::
@end menu

@node Introduction, Major Entry Points, Top, Top
@chapter Introduction

@cindex Comparing files and buffers
@cindex Merging files and buffers
@cindex Patching files and buffers
@cindex Finding differences

Ediff provides a convenient way for simultaneous browsing through
the differences between a pair (or a triple) of files or buffers
(which are called @samp{variants} for our purposes).  The
files being compared, file-A, file-B, and file-C (if applicable) are
shown in separate windows (side by side, one above the another, or in
separate frames), and the differences are highlighted as you step
through them.  You can also copy difference regions from one buffer to
another (and recover old differences if you change your mind).

Another powerful feature is the ability to merge a pair of files into a
third buffer.  Merging with an ancestor file is also supported.
Furthermore, Ediff is equipped with directory-level capabilities that
allow the user to conveniently launch browsing or merging sessions on
groups of files in two (or three) different directories.

In addition, Ediff can apply a patch to a file and then let you step through
both files, the patched and the original one, simultaneously,
difference-by-difference.  You can even apply a patch right out of a mail
buffer, i.e., patches received by mail don't even have to be saved.  Since
Ediff lets you copy differences between variants, you can, in effect, apply
patches selectively (i.e., you can copy a difference region from
@file{file.orig} to @file{file}, thereby undoing any particular patch that
you don't like).

Ediff even understands multi-file patches and can apply them interactively!
(Ediff can recognize multi-file patches only if they are in the context
format or GNU unified format.  All other patches are treated as 1-file
patches.  Ediff is [hopefully] using the same algorithm as @code{patch} to
determine which files need to be patched.)

Ediff is aware of version control, which lets you compare
files with their older versions.  Ediff also works with remote and
compressed files, automatically ftp'ing them over and uncompressing them.
@xref{Remote and Compressed Files}, for details.

This package builds upon ideas borrowed from Emerge, and several of Ediff's
functions are adaptations from Emerge.  Although Ediff subsumes and greatly
extends Emerge, much of the functionality in Ediff is influenced by Emerge.
The architecture and the interface are, of course, drastically different.

@node Major Entry Points, Session Commands, Introduction, Top
@chapter Major Entry Points

When Ediff starts up, it displays a small control window, which accepts the
Ediff commands, and two or three windows displaying the files to be compared
or merged. The control window can be in its own small frame or it can be
part of a bigger frame that displays other buffers. In any case, it is
important that the control window be active (i.e., be the one receiving the
keystrokes) when you use Ediff. You can switch to other Emacs buffers at
will and even edit the files currently being compared with Ediff and then
switch back to Ediff at any time by activating the appropriate Emacs windows.

Ediff can be invoked interactively using the following functions, which can
be run either from the minibuffer or from the menu bar.  In the menu bar,
all Ediff's entry points belong to three submenus of the Tools menu:
Compare, Merge, and Apply Patch.

@table @code
@item ediff-files
@itemx ediff
@findex ediff-files
@findex ediff
Compare two files.

@item ediff-backup
@findex ediff-backup
Compare a file with its backup. If there are several numerical backups, use
the latest. If the file is itself a backup, then compare it with its
original.

@item ediff-current-file
@findex ediff-current-file
Compare the buffer with its file on disk. This function can be used as a
safe version of @code{revert-buffer}.

@item ediff-buffers
@findex ediff-buffers
Compare two buffers.

@item ediff-files3
@itemx ediff3
@findex ediff-files3
@findex ediff3
Compare three files.

@item ediff-buffers3
@findex ediff-buffers3
Compare three buffers.

@item edirs
@itemx ediff-directories
@findex edirs
@findex ediff-directories
 Compare files common to two directories.
@item edirs3
@itemx ediff-directories3
@findex edirs3
@findex ediff-directories3
 Compare files common to three directories.
@item edir-revisions
@itemx ediff-directory-revisions
@findex ediff-directory-revisions
@findex edir-revisions
 Compare versions of files in a given directory.  Ediff selects only the
files that are under version control.
@item edir-merge-revisions
@itemx ediff-merge-directory-revisions
@findex edir-merge-revisions
@findex ediff-merge-directory-revisions
 Merge versions of files in a given directory.  Ediff selects only the
files that are under version control.
@item edir-merge-revisions-with-ancestor
@itemx ediff-merge-directory-revisions-with-ancestor
@findex edir-merge-revisions-with-ancestor
@findex ediff-merge-directory-revisions-with-ancestor
 Merge versions of files in a given directory using other versions as
ancestors.  Ediff selects only the files that are under version control.

@item ediff-windows-wordwise
@findex ediff-windows-wordwise
Compare windows word-by-word.

@item ediff-windows-linewise
@findex ediff-windows-linewise
Compare windows line-by-line.

@item ediff-regions-wordwise
@findex ediff-regions-wordwise
Compare regions word-by-word.  The regions can come from the same buffer
and they can even overlap.  You will be asked to specify the buffers that
contain the regions, which you want to compare. For each buffer, you will
also be asked to mark the regions to be compared. Pay attention to the
messages that appear in the minibuffer.

@item ediff-regions-linewise
@findex ediff-regions-linewise
Similar to @code{ediff-windows-linewise}, but compares the regions
line-by-line. See @code{ediff-windows-linewise} for more details.

@item ediff-revision
@findex ediff-revision
 Compare versions of the current buffer, if the buffer is visiting
 a file under version control.

@item ediff-patch-file
@itemx epatch
@findex ediff-patch-file
@findex epatch

Patch a file or multiple files, then compare.  If the patch applies to just
one file, Ediff will invoke a regular comparison session.  If it is a
multi-file patch, then a session group interface will be used and the user
will be able to patch the files selectively.  @xref{Session Groups}, for
more details.

Since the patch might be in a buffer or a file, you will be asked which is
the case. To avoid this extra prompt, you can invoke this command with a
prefix argument.  With an odd prefix argument, Ediff assumes the patch
is in a file; with an even argument, a buffer is assumed.

Note that @code{ediff-patch-file} will actually use the @code{patch}
utility to change the original files on disk.  This is not that
dangerous, since you will always have the original contents of the file
saved in another file that has the extension @file{.orig}.
Furthermore, if the file is under version control, then you can always back
out to one of the previous versions (see the section on Version Control in
the Emacs manual).

@code{ediff-patch-file} is careful about versions control: if the file
to be patched is checked in, then Ediff will offer to check it out, because
failing to do so may result in the loss of the changes when the file is
checked out the next time.

If you don't intend to modify the file via the patch and just want to see
what the patch is all about (and decide later), then
@code{ediff-patch-buffer} might be a better choice.

@item ediff-patch-buffer
@itemx epatch-buffer
@findex ediff-patch-buffer
@findex epatch-buffer
Patch a buffer, then compare.  The buffer being patched and the file visited
by that buffer (if any) is @emph{not} modified.  The result of the patch
appears in some other buffer that has the name ending with @emph{_patched}.

This function would refuse to apply a multifile patch to a buffer.  Use
@code{ediff-patch-file} for that (and when you want the original file to be
modified by the @code{patch} utility).

Since the patch might be in a buffer or a file, you will be asked which is
the case. To avoid this extra prompt, you can invoke this command with a
prefix argument.  With an odd prefix argument, Ediff assumes the patch
is in a file; with an even argument, a buffer is assumed.

@item ediff-merge-files
@itemx ediff-merge
@findex ediff-merge-files
@findex ediff-merge
Merge two files.

@item ediff-merge-files-with-ancestor
@itemx ediff-merge-with-ancestor
@findex ediff-merge-files-with-ancestor
@findex ediff-merge-with-ancestor
Like @code{ediff-merge}, but with a third ancestor file.

@item ediff-merge-buffers
@findex ediff-merge-buffers
Merge two buffers.

@item ediff-merge-buffers-with-ancestor
@findex ediff-merge-buffers-with-ancestor
Same but with ancestor.


@item edirs-merge
@itemx ediff-merge-directories
@findex edirs-merge
@findex ediff-merge-directories
 Merge files common to two directories.
@item edirs-merge-with-ancestor
@itemx ediff-merge-directories-with-ancestor
@findex edirs-merge-with-ancestor
@findex ediff-merge-directories-with-ancestor
 Same but using files in a third directory as ancestors.
 If a pair of files doesn't have an ancestor in the ancestor-directory, you
 will still be able to merge them without the ancestor.

@item ediff-merge-revisions
@findex ediff-merge-revisions
Merge two versions of the file visited by the current buffer.

@item ediff-merge-revisions-with-ancestor
@findex ediff-merge-revisions-with-ancestor
Same but with ancestor.

@item ediff-documentation
@findex ediff-documentation
Brings up this manual.

@item ediff-show-registry
@itemx eregistry
Brings up Ediff session registry.  This feature enables you to quickly find
and restart active Ediff sessions.
@end table

@noindent
If you want Ediff to be loaded from the very beginning of your Emacs
session, you should put this line in your @file{~/.emacs} file:

@example
(require 'ediff)
@end example

@noindent
Otherwise, Ediff will be loaded automatically when you use one of the
above functions, either directly or through the menus.

When the above functions are invoked, the user is prompted for all the
necessary information---typically the files or buffers to compare, merge, or
patch.  Ediff tries to be smart about these prompts.  For instance, in
comparing/merging files, it will offer the visible buffers as defaults.  In
prompting for files, if the user enters a directory, the previously input
file name will be appended to that directory.  In addition, if the variable
@code{ediff-use-last-dir} is not @code{nil}, Ediff will offer
previously entered directories as defaults (which will be maintained
separately for each type of file, A, B, or C).
@vindex @code{ediff-use-last-dir}

All the above functions use the POSIX @code{diff} or @code{diff3} programs
to find differences between two files.  They process the @code{diff} output
and display it in a convenient form.  At present, Ediff understands only
the plain output from diff.  Options such as @samp{-c} are not supported,
nor is the format produced by incompatible file comparison programs such as
the VMS version of @code{diff}.

The functions @code{ediff-files}, @code{ediff-buffers},
@code{ediff-files3}, @code{ediff-buffers3} first display the coarse,
line-based difference regions, as reported by the @code{diff} program.  The
total number of difference regions and the current difference number are
always displayed in the mode line of the control window.

Since @code{diff} may report fairly large chunks of text as being different,
even though the difference may be localized to just a few words or even
to the white space or line breaks, Ediff further @emph{refines} the
regions to indicate which exact words differ.  If the only difference is
in the white space and line breaks, Ediff says so.

On a color display, fine differences are highlighted with color; on a
monochrome display, they are underlined.  @xref{Highlighting Difference
Regions}, for information on how to customize this.

The commands @code{ediff-windows-wordwise},
@code{ediff-windows-linewise}, @code{ediff-regions-wordwise} and
@code{ediff-regions-linewise} do comparison on parts of existing Emacs
buffers.  The commands @code{ediff-windows-wordwise} and
@code{ediff-regions-wordwise} are intended for relatively small segments
of buffers (e.g., up to 100 lines, depending on the speed of your machine),
as they perform comparison on the basis of words rather than lines.
(Word-wise comparison of large chunks of text can be slow.)

To compare large regions, use @code{ediff-regions-linewise}.  This
command displays differences much like @code{ediff-files} and
@code{ediff-buffers}.

The functions @code{ediff-patch-file} and @code{ediff-patch-buffer} apply a
patch to a file or a buffer and then run Ediff on the appropriate
files/buffers, displaying the difference regions.

The entry points @code{ediff-directories}, @code{ediff-merge-directories},
etc., provide a convenient interface for comparing and merging files in
different directories.  The user is presented with Dired-like interface from
which one can run a group of related Ediff sessions.

For files under version control, @code{ediff-revision} lets you compare
the file visited by the current buffer to one of its checked-in versions.
You can also compare two checked-in versions of the visited file.
Moreover, the functions @code{ediff-directory-revisions},
@code{ediff-merge-directory-revisions}, etc., let you run a group of
related Ediff sessions by taking a directory and comparing (or merging)
versions of files in that directory.

@node Session Commands, Registry of Ediff Sessions, Major Entry Points, Top
@chapter Session Commands

All Ediff commands are displayed in a Quick Help window, unless you type
@kbd{?} to shrink the window to just one line.  You can redisplay the help
window by typing @kbd{?} again.  The Quick Help commands are detailed below.

Many Ediff commands take numeric prefix arguments.  For instance, if you
type a number, say 3, and then @kbd{j} (@code{ediff-jump-to-difference}),
Ediff moves to the third difference region.  Typing 3 and then @kbd{a}
(@code{ediff-diff-to-diff}) copies the 3rd difference region from variant A
to variant B.  Likewise, 4 followed by @kbd{ra} restores the 4th difference
region in buffer A (if it was previously written over via the command
@kbd{a}).

Some commands take negative prefix arguments as well.  For instance, typing
@kbd{-} and then @kbd{j} will make the last difference region
current.  Typing @kbd{-2} then @kbd{j} makes the penultimate difference
region current, etc.

Without the prefix argument, all commands operate on the currently
selected difference region.  You can make any difference region
current using the various commands explained below.

For some commands, the actual value of the prefix argument is
immaterial.  However, if supplied, the prefix argument may modify the
command (see @kbd{ga}, @kbd{gb}, and @kbd{gc}).

@menu
* Quick Help Commands::             Frequently used commands.
* Other Session Commands::          Commands that are not bound to keys.
@end menu

@node Quick Help Commands,Other Session Commands,,Session Commands
@section Quick Help Commands

@table @kbd
@item ?
@kindex ?
Toggles the Ediff Quick Help window ON and OFF.
@item G
@kindex G
Prepares a mail buffer for sending a praise or a curse to the Ediff maintainer.

@item E
@kindex E
Brings up the top node of this manual, where you can find further
information on the various Ediff functions and advanced issues, such as
customization, session groups, etc.

@item v
@kindex v
Scrolls up buffers A and B (and buffer C where appropriate) in a
coordinated fashion.
@item V
@kindex V
Scrolls the buffers down.

@item <
@kindex <
Scrolls the buffers to the left simultaneously.
@item >
@kindex >
Scrolls buffers to the right.

@item wd
@kindex wd
Saves the output from the diff utility, for further reference.

With prefix argument, saves the plain output from @code{diff} (see
@code{ediff-diff-program} and @code{ediff-diff-options}).  Without the
argument, it saves customized @code{diff} output (see
@code{ediff-custom-diff-program} and @code{ediff-custom-diff-options}), if
it is available.

@item wa
@kindex wa
Saves buffer A, if it was modified.
@item wb
@kindex wb
Saves buffer B, if it was modified.
@item wc
@kindex wc
Saves buffer C, if it was modified (if you are in a session that
compares three files simultaneously).

@item a
@kindex a
@emph{In comparison sessions:}
Copies the current difference region (or the region specified as the prefix
to this command) from buffer A to buffer B.
Ediff saves the old contents of buffer B's region; it can
be restored via the command @kbd{rb}, which see.

@emph{In merge sessions:}
Copies the current difference region (or the region specified as the prefix
to this command) from buffer A to the merge buffer.  The old contents of
this region in buffer C can be restored via the command @kbd{r}.

@item b
@kindex b
Works similarly, but copies the current difference region from buffer B to
buffer A (in @emph{comparison sessions}) or the merge buffer (in
@emph{merge sessions}).

Ediff saves the old contents of the difference region copied over; it can
be reinstated via the command @kbd{ra} in comparison sessions and
@kbd{r} in merge sessions.

@item ab
@kindex ab
Copies the current difference region (or the region specified as the prefix
to this command) from buffer A to buffer B.  This (and the next five)
command is enabled only in sessions that compare three files
simultaneously.  The old region in buffer B is saved and can be restored
via the command @kbd{rb}.
@item ac
@kindex ac
Copies the difference region from buffer A to buffer C.
The old region in buffer C is saved and can be restored via the command
@kbd{rc}.
@item ba
@kindex ba
Copies the difference region from buffer B to buffer A.
The old region in buffer A is saved and can be restored via the command
@kbd{ra}.
@item bc
@kindex bc
Copies the difference region from buffer B to buffer C.
The command @kbd{rc} undoes this.
@item ca
@kindex ca
Copies the difference region from buffer C to buffer A.
The command @kbd{ra} undoes this.
@item cb
@kindex cb
Copies the difference region from buffer C to buffer B.
The command @kbd{rb} undoes this.

@item p
@itemx DEL
@kindex p
@kindex DEL
Makes the previous difference region current.
@item n
@itemx SPC
@kindex n
@kindex SPC
Makes the next difference region current.

@item j
@itemx -j
@itemx Nj
@kindex j
Makes the very first difference region current.

@kbd{-j} makes the last region current.  Typing a number, N, and then `j'
makes the difference region N current.  Typing -N (a negative number) then
`j' makes current the region Last - N.

@item ga
@kindex ga
Makes current the difference region closest to the position of the point in
buffer A.

However, with a prefix argument, Ediff would position all variants
around the area indicated by the current point in buffer A: if
the point is inside a difference region, then the variants will be
positioned at this difference region.  If the point is not in any difference
region, then it is in an area where all variants agree with each other.  In
this case, the variants will be positioned so that each would display this
area (of agreement).
@item gb
@kindex gb
Makes current the difference region closest to the position of the point in
buffer B.

With a prefix argument, behaves like @kbd{ga}, but with respect to buffer B.
@item gc
@kindex gc
@emph{In merge sessions:}
makes current the difference region closest to the point in the merge buffer.

@emph{In 3-file comparison sessions:}
makes current the region closest to the point in buffer C.

With a prefix argument, behaves like @kbd{ga}, but with respect to buffer C.

@item !
@kindex !
Recomputes the difference regions, bringing them up to date.  This is often
needed because it is common to do all sorts of editing during Ediff
sessions, so after a while, the highlighted difference regions may no
longer reflect the actual differences among the buffers.

@item *
@kindex *
Forces refinement of the current difference region, which highlights the exact
words of disagreement among the buffers.  With a negative prefix argument,
unhighlights the current region.

Forceful refinement may be needed if Ediff encounters a difference region
that is larger than @code{ediff-auto-refine-limit}.  In this situation,
Ediff doesn't do automatic refinement in order to improve response time.
(Ediff doesn't auto-refine on dumb terminals as well, but @kbd{*} still
works there.  However, the only useful piece of information it can tell you
is whether or not the difference regions disagree only in the amount of
white space.)

This command is also useful when the highlighted fine differences are
no longer current, due to user editing.

@item m
@kindex m
Displays the current Ediff session in a frame as wide as the physical
display.  This is useful when comparing files side-by-side.  Typing `m' again
restores the original size of the frame.

@item |
@kindex |
Toggles the horizontal/vertical split of the Ediff display.  Horizontal
split is convenient when it is possible to compare files
side-by-side.  If the frame in which files are displayed is too narrow
and lines are cut off, typing @kbd{m} may help some.

@item @@
@kindex @@
Toggles auto-refinement of difference regions (i.e., automatic highlighting
of the exact words that differ among the variants).  Auto-refinement is
turned off on devices where Emacs doesn't support highlighting.

On slow machines, it may be advantageous to turn auto-refinement off.  The
user can always forcefully refine specific difference regions by typing
@kbd{*}.

@item h
@kindex h
Cycles between full highlighting, the mode where fine differences are not
highlighted (but computed), and the mode where highlighting is done with
@acronym{ASCII} strings.  The latter is not really recommended, unless on a dumb TTY.

@item r
@kindex r
Restores the old contents of the region in the merge buffer.
(If you copied a difference region from buffer A or B into the merge buffer
using the commands @kbd{a} or @kbd{b}, Ediff saves the old contents of the
region in case you change your mind.)

This command is enabled in merge sessions only.

@item ra
@kindex ra
Restores the old contents of the current difference region in buffer A,
which was previously saved when the user invoked one of these commands:
@kbd{b}, @kbd{ba}, @kbd{ca}, which see.  This command is enabled in
comparison sessions only.
@item rb
@kindex rb
Restores the old contents of the current difference region in buffer B,
which was previously saved when the user invoked one of these commands:
@kbd{a}, @kbd{ab}, @kbd{cb}, which see.  This command is enabled in
comparison sessions only.
@item rc
@kindex rc
Restores the old contents of the current difference region in buffer C,
which was previously saved when the user invoked one of these commands:
@kbd{ac}, @kbd{bc}, which see.  This command is enabled in 3-file
comparison sessions only.

@item ##
@kindex ##
Tell Ediff to skip over regions that disagree among themselves only in the
amount of white space and line breaks.

Even though such regions will be skipped over, you can still jump to any
one of them by typing the region number and then `j'.  Typing @kbd{##}
again puts Ediff back in the original state.

@item #c
@kindex #c
@vindex ediff-ignore-case-option
@vindex ediff-ignore-case-option3
@vindex ediff-ignore-case
Toggle case sensitivity in the diff program. All diffs are recomputed.
Case sensitivity is controlled by the variables
@code{ediff-ignore-case-option}, @code{ediff-ignore-case-option3},
and @code{ediff-ignore-case}, which are explained elsewhere.

@item #h
@itemx #f
@kindex #f
@kindex #h
Ediff works hard to ameliorate the effects of boredom in the workplace...

Quite often differences are due to identical replacements (e.g., the word
`foo' is replaced with the word `bar' everywhere).  If the number of regions
with such boring differences exceeds your tolerance threshold, you may be
tempted to tell Ediff to skip these regions altogether (you will still be able
to jump to them via the command @kbd{j}).  The above commands, @kbd{#h}
and @kbd{#f}, may well save your day!

@kbd{#h} prompts you to specify regular expressions for each
variant.  Difference regions where each variant's region matches the
corresponding regular expression will be skipped from then on.  (You can
also tell Ediff to skip regions where at least one variant matches its
regular expression.)

@kbd{#f} does dual job: it focuses on regions that match the corresponding
regular expressions.  All other regions will be skipped
over.  @xref{Selective Browsing}, for more.

@item A
@kindex A
Toggles the read-only property in buffer A.
If file A is under version control and is checked in, it is checked out
(with your permission).
@item B
@kindex B
Toggles the read-only property in buffer B.
If file B is under version control and is checked in, it is checked out.
@item C
@kindex C
Toggles the read-only property in buffer C (in 3-file comparison sessions).
If file C is under version control and is checked in, it is checked out.

@item ~
@kindex ~
Swaps the windows where buffers A and B are displayed.  If you are comparing
three buffers at once, then this command would rotate the windows among
buffers A, B, and C.

@item i
@kindex i
Displays all kinds of useful data about the current Ediff session.
@item D
@kindex D
Runs @code{ediff-custom-diff-program} on the variants and displays the
buffer containing the output.  This is useful when you must send the output
to your Mom.

With a prefix argument, displays the plain @code{diff} output.
@xref{Patch and Diff Programs}, for details.

@item R
@kindex R
Displays a list of currently active Ediff sessions---the Ediff Registry.
You can then restart any of these sessions by either clicking on a session
record or by putting the cursor over it and then typing the return key.

(Some poor souls leave so many active Ediff sessions around that they loose
track of them completely...  The `R' command is designed to save these
people from the recently discovered Ediff Proficiency Syndrome.)

Typing @kbd{R} brings up Ediff Registry only if it is typed into an Ediff
Control Panel.  If you don't have a control panel handy, type this in the
minibuffer: @kbd{M-x eregistry}.  @xref{Registry of Ediff Sessions}.

@item M
@kindex M
Shows the session group buffer that invoked the current Ediff session.
@xref{Session Groups}, for more information on session groups.

@item z
@kindex z
Suspends the current Ediff session.  (If you develop a condition known as
Repetitive Ediff Injury---a serious but curable illness---you must change
your current activity.  This command tries hard to hide all Ediff-related
buffers.)

The easiest way to resume a suspended Ediff session is through the registry
of active sessions.  @xref{Registry of Ediff Sessions}, for details.
@item q
@kindex q
Terminates this Ediff session.  With a prefix argument (e.g.,@kbd{1q}), asks
if you also want to delete the buffers of the variants.
Modified files and the results of merges are never deleted.

@item %
@kindex %
Toggles narrowing in Ediff buffers.  Ediff buffers may be narrowed if you
are comparing only parts of these buffers via the commands
@code{ediff-windows-*} and @code{ediff-regions-*}, which see.

@item C-l
@kindex C-l
Restores the usual Ediff window setup.  This is the quickest way to resume
an Ediff session, but it works only if the control panel of that session is
visible.

@item $$
@kindex $$
While merging with an ancestor file, Ediff is determined to reduce user's
wear and tear by saving him and her much of unproductive, repetitive
typing.  If it notices that, say, file A's difference region is identical to
the same difference region in the ancestor file, then the merge buffer will
automatically get the difference region taken from buffer B.  The rationale
is that this difference region in buffer A is as old as that in the
ancestor buffer, so the contents of that region in buffer B represents real
change.

You may want to ignore such `obvious' merges and concentrate on difference
regions where both files `clash' with the ancestor, since this means that
two different people have been changing this region independently and they
had different ideas on how to do this.

The above command does this for you by skipping the regions where only one
of the variants clashes with the ancestor but the other variant agrees with
it.  Typing @kbd{$$} again undoes this setting.

@item $*
@kindex $*
When merging files with large number of differences, it is sometimes
convenient to be able to skip the difference regions for which you already
decided which variant is most appropriate. Typing @kbd{$*} will accomplish
precisely this.

To be more precise, this toggles the check for whether the current merge is
identical to its default setting, as originally decided by Ediff.  For
instance, if Ediff is merging according to the `combined' policy, then the
merge region is skipped over if it is different from the combination of the
regions in buffers A and B.  (Warning: swapping buffers A and B will confuse
things in this respect.)  If the merge region is marked as `prefer-A' then
this region will be skipped if it differs from the current difference
region in buffer A, etc.

@item /
@kindex /
Displays the ancestor file during merges.
@item &
@kindex &
In some situations, such as when one of the files agrees with the ancestor file
on a difference region and the other doesn't, Ediff knows what to do: it copies
the current difference region from the second buffer into the merge buffer.

In other cases, the right course of action is not that clearcut, and Ediff
would use a default action.  The above command changes the default action.
The default action can be @samp{default-A} (choose the region from buffer
A), @samp{default-B} (choose the region from buffer B), or @samp{combined}
(combine the regions from the two buffers).
@xref{Merging and diff3}, for further details.

The command @kbd{&} also affects the regions in the merge buffers that have
@samp{default-A}, @samp{default-B}, or @samp{combined} status, provided
they weren't changed with respect to the original.  For instance, if such a
region has the status @samp{default-A} then changing the default action to
@samp{default-B} will also replace this merge-buffer's region with the
corresponding region from buffer B.

@item s
@kindex s
Causes the merge window shrink to its minimum size, thereby exposing as much
of the variant buffers as possible.  Typing `s' again restores
the original size of that window.

With a positive prefix argument, this command enlarges the merge window.
E.g., @kbd{4s} increases the size of the window by about 4 lines, if
possible.  With a negative numeric argument, the size of the merge window
shrinks by that many lines, if possible.  Thus, @kbd{-s} shrinks the window
by about 1 line and @kbd{-3s} by about 3 lines.

This command is intended only for temporary viewing; therefore, Ediff
restores window C to its original size whenever it makes any other change
in the window configuration.  However, redisplaying (@kbd{C-l}) or jumping
to another difference does not affect window C's size.

The split between the merge window and the variant windows is controlled by
the variable @code{ediff-merge-window-share}, which see.

@item +
@kindex +
Combines the difference regions from buffers A and B and copies the
result into the merge buffer.  @xref{Merging and diff3}, and the
variables @code{ediff-combine-diffs} and @code{ediff-combination-pattern}.


@item =
@kindex =
You may run into situations when a large chunk of text in one file has been
edited and then moved to a different place in another file.  In such a case,
these two chunks of text are unlikely to belong to the same difference
region, so the refinement feature of Ediff will not be able to tell you
what exactly differs inside these chunks.  Since eyeballing large pieces of
text is contrary to human nature, Ediff has a special command to help
reduce the risk of developing a cataract.

In other situations, the currently highlighted region might be big and you
might want to reconcile of them interactively.

All of this can be done with the above command, @kbd{=}, which
compares regions within Ediff buffers.  Typing @kbd{=} creates a
child Ediff session for comparing regions in buffers A, B, or
C as follows.

First, you will be asked whether you want to compare the fine differences
between the currently highlighted buffers on a word-by-word basis. If you
accept, a child Ediff session will start using the currently highlighted
regions. Ediff will let you step over the differences word-wise.

If you reject the offer, you will be asked to select regions of your choice.

@emph{If you are comparing 2 files or buffers:}
Ediff will ask you to select regions in buffers A and B.

@emph{If you are comparing 3 files or buffers simultaneously:} Ediff will
ask you to choose buffers and then select regions inside those buffers.

@emph{If you are merging files or buffers (with or without ancestor):}
Ediff will ask you to choose which buffer (A or B) to compare with the
merge buffer and then select regions in those buffers.

@end table

@node Other Session Commands,,Quick Help Commands,Session Commands
@section Other Session Commands

The following commands can be invoked from within any Ediff session,
although some of them are not bound to a key.

@table @code
@item eregistry
@itemx ediff-show-registry
@findex eregistry
@findex ediff-show-registry
This command brings up the registry of active Ediff sessions.  Ediff
registry is a device that can be used to resume any active Ediff session
(which may have been postponed because the user switched to some other
activity).  This command is also useful for switching between multiple
active Ediff sessions that are run at the same time.  The function
@code{eregistry} is an alias for @code{ediff-show-registry}.
@xref{Registry of Ediff Sessions}, for more information on this registry.

@item ediff-toggle-multiframe
@findex ediff-toggle-multiframe
Changes the display from the multi-frame mode (where the quick help window
is in a separate frame) to the single-frame mode (where all Ediff buffers
share the same frame), and vice versa.  See
@code{ediff-window-setup-function} for details on how to make either of
these modes the default one.

This function can also be invoked from the Menubar.  However, in some
cases, the change will take place only after you execute one of the Ediff
commands, such as going to the next difference or redisplaying.

@item ediff-toggle-use-toolbar
@findex ediff-toggle-use-toolbar
Available in XEmacs only.  The Ediff toolbar provides quick access to some
of the common Ediff functions.  This function toggles the display of the
toolbar.  If invoked from the menubar, the function may take sometimes
effect only after you execute an Ediff command, such as going to the next
difference.

@item ediff-use-toolbar-p
@vindex ediff-use-toolbar-p
The use of the toolbar can also be specified via the variable
@code{ediff-use-toolbar-p} (default is @code{t}).  This variable can be set
only in @file{.emacs} --- do @strong{not} change it interactively.  Use the
function @code{ediff-toggle-use-toolbar} instead.

@item ediff-revert-buffers-then-recompute-diffs
@findex ediff-revert-buffers-then-recompute-diffs
This command reverts the buffers you are comparing and recomputes their
differences.  It is useful when, after making changes, you decided to
make a fresh start, or if at some point you changed the files being
compared but want to discard any changes to comparison buffers that were
done since then.

This command normally asks for confirmation before reverting files.
With a prefix argument, it reverts files without asking.


@item ediff-profile
@findex ediff-profile
Ediff has an admittedly primitive (but useful) facility for profiling
Ediff's commands.  It is meant for Ediff maintenance---specifically, for
making it run faster.  The function @code{ediff-profile} toggles
profiling of ediff commands.
@end table

@node Registry of Ediff Sessions, Session Groups, Session Commands, Top
@chapter Registry of Ediff Sessions

Ediff maintains a registry of all its invocations that are
still @emph{active}.  This feature is very convenient for switching among
active Ediff sessions or for quickly restarting a suspended Ediff session.

The focal point of this activity is a buffer
called @emph{*Ediff Registry*}.  You can display this buffer by typing
@kbd{R} in any Ediff Control Buffer or Session Group Buffer
(@pxref{Session Groups}), or by typing
@kbd{M-x eregistry} into the Minibuffer.
The latter would be the fastest way to bring up the registry
buffer if no control or group buffer is displayed in any of the visible
Emacs windows.
If you are in a habit of running multiple long Ediff sessions and often need to
suspend, resume, or switch between them, it may be a good idea to have the
registry buffer permanently displayed in a separate, dedicated window.

The registry buffer has several convenient key bindings.
For instance, clicking mouse button 2 or typing
@kbd{RET} or @kbd{v} over any session record resumes that session.
Session records in the registry buffer provide a fairly complete
description of each session, so it is usually easy to identify the right
session to resume.

Other useful commands are bound to @kbd{SPC} (next registry record)
and @kbd{DEL} (previous registry record).  There are other commands as well,
but you don't need to memorize them, since they are listed at the top of
the registry buffer.

@node Session Groups, Remote and Compressed Files, Registry of Ediff Sessions, Top
@chapter Session Groups

Several major entries of Ediff perform comparison and merging on
directories.  On entering @code{ediff-directories},
@code{ediff-directories3},
@code{ediff-merge-directories},
@code{ediff-merge-directories-with-ancestor},
@code{ediff-directory-revisions},
@code{ediff-merge-directory-revisions}, or
@code{ediff-merge-directory-revisions-with-ancestor},
the user is presented with a
Dired-like buffer that lists files common to the directories involved along
with their sizes.  (The list of common files can be further filtered through
a regular expression, which the user is prompted for.)  We call this buffer
@emph{Session Group Panel} because all Ediff sessions associated with the
listed files will have this buffer as a common focal point.

Clicking button 2 or typing @kbd{RET} or @kbd{v} over a
record describing files invokes Ediff in the appropriate mode on these
files.  You can come back to the session group buffer associated with a
particular invocation of Ediff by typing @kbd{M} in Ediff control buffer of
that invocation.

Many commands are available in the session group buffer; some are
applicable only to certain types of work.  The relevant commands are always
listed at the top of each session group buffer, so there is no need to
memorize them.

In directory comparison or merging, a session group panel displays only the
files common to all directories involved.  The differences are kept in a
separate @emph{directory difference buffer} and are conveniently displayed
by typing @kbd{D} to the corresponding session group panel.  Thus, as an
added benefit, Ediff can be used to compare the contents of up to three
directories.

@cindex Directory difference buffer
Sometimes it is desirable to copy some files from one directory to another
without exiting Ediff. The @emph{directory difference buffer}, which is
displayed by typing @kbd{D} as discussed above, can be used for this
purpose. If a file is, say, in Ediff's Directory A, but is missing in
Ediff's Directory B (Ediff will refuse to override existing files), then
typing @kbd{C} or clicking mouse button 2 over that file (which must be
displayed in directory difference buffer) will copy that file from
Directory A to Directory B.

Session records in session group panels are also marked with @kbd{+}, for
active sessions, and with @kbd{-}, for finished sessions.

Sometimes, it is convenient to exclude certain sessions from a group.
Usually this happens when the user doesn't intend to run Ediff of certain
files in the group, and the corresponding session records just add clutter
to the session group buffer.  To help alleviate this problem, the user can
type @kbd{h} to mark a session as a candidate for exclusion and @kbd{x} to
actually hide the marked sessions.  There actions are reversible: with a
prefix argument, @kbd{h} unmarks the session under the cursor, and @kbd{x}
brings the hidden sessions into the view (@kbd{x} doesn't unmark them,
though, so the user has to explicitly unmark the sessions of interest).

Group sessions also understand the command @kbd{m}, which marks sessions
for future operations (other than hiding) on a group of sessions.  At present,
the only such group-level operation is the creation of a multi-file patch.

@vindex ediff-autostore-merges
For group sessions created to merge files, Ediff can store all merges
automatically in a directory.  The user is asked to specify such directory
if the value of @code{ediff-autostore-merges} is non-@code{nil}.  If the value is
@code{nil}, nothing is done to the merge buffers---it will be the user's
responsibility to save them.  If the value is @code{t}, the user will be
asked where to save the merge buffers in all merge jobs, even those that do
not originate from a session group.  It the value is neither @code{nil} nor
@code{t}, the merge buffer is saved @emph{only} if this merge session was
invoked from a session group.  This behavior is implemented in the function
@code{ediff-maybe-save-and-delete-merge}, which is a hook in
@code{ediff-quit-merge-hook}.  The user can supply a different hook, if
necessary.

The variable @code{ediff-autostore-merges} is buffer-local, so it can be
set on a per-buffer basis.  Therefore, use @code{setq-default} to change
this variable globally.

@cindex Multi-file patches
A multi-file patch is a concatenated output of several runs of the Unix
@code{diff} command (some versions of @code{diff} let you create a
multi-file patch in just one run).  Ediff facilitates creation of
multi-file patches as follows.  If you are in a session group buffer
created in response to @code{ediff-directories} or
@code{ediff-directory-revisions}, you can mark (by typing @kbd{m}) the
desired Ediff sessions and then type @kbd{P} to create a
multi-file patch of those marked sessions.
Ediff will then display a buffer containing the patch.
The patch is generated by invoking @code{diff} on all marked individual
sessions (represented by files) and session groups (represented by
directories).  Ediff will also recursively descend into any @emph{unmarked}
session group and will search for marked sessions there.  In this way, you
can create multi-file patches that span file subtrees that grow out of
any given directory.

In an @code{ediff-directories} session, it is enough to just mark the
requisite sessions.  In @code{ediff-directory-revisions} revisions, the
marked sessions must also be active, or else Ediff will refuse to produce a
multi-file patch.  This is because, in the latter-style sessions, there are
many ways to create diff output, and it is easier to handle by running
Ediff on the inactive sessions.

Last, but not least, by typing @kbd{==}, you can quickly find out which
sessions have identical entries, so you won't have to run Ediff on those
sessions.  This, however, works only on local, uncompressed files.
For compressed or remote files, this command won't report anything.
Likewise, you can use @kbd{=h} to mark sessions with identical entries
for hiding or, with @kbd{=m}, for further operations.

The comparison operations @kbd{==}, @kbd{=h}, and @kbd{=m} can recurse into
subdirectories to see if they have identical contents (so the user will not
need to descend into those subdirectories manually). These commands ask the
user whether or not to do a recursive descent.



@node Remote and Compressed Files, Customization, Session Groups, Top
@chapter Remote and Compressed Files

Ediff works with remote, compressed, and encrypted files.  Ediff
supports @file{ange-ftp.el}, @file{jka-compr.el}, @file{uncompress.el}
and @file{crypt++.el}, but it may work with other similar packages as
well.  This means that you can compare files residing on another
machine, or you can apply a patch to a file on another machine.  Even
the patch itself can be a remote file!

When patching compressed or remote files, Ediff does not rename the source
file (unlike what the @code{patch} utility would usually do).  Instead, the
source file retains its name and the result of applying the patch is placed
in a temporary file that has the suffix @file{_patched} attached.
Generally, this applies to files that are handled using black magic, such
as special file handlers (ange-ftp and some compression and encryption
packages also use this method).

Regular files are treated by the @code{patch} utility in the usual manner,
i.e., the original is renamed into @file{source-name.orig} and the result
of the patch is placed into the file source-name (@file{_orig} is used
on systems like DOS, etc.)

@node Customization, Credits, Remote and Compressed Files, Top
@chapter Customization

Ediff has a rather self-explanatory interface, and in most cases you
won't need to change anything.  However, should the need arise, there are
extensive facilities for changing the default behavior.

Most of the customization can be done by setting various variables in the
@file{.emacs} file.  Some customization (mostly window-related
customization and faces) can be done by putting appropriate lines in
@file{.Xdefaults}, @file{.xrdb}, or whatever X resource file is in use.

With respect to the latter, please note that the X resource
for Ediff customization is `Ediff', @emph{not} `emacs'.
@xref{Window and Frame Configuration},
@xref{Highlighting Difference Regions}, for further details.  Please also
refer to Emacs manual for the information on how to set Emacs X resources.

@menu
* Hooks::                       Customization via the hooks.
* Quick Help Customization::    How to customize Ediff's quick help feature.
* Window and Frame Configuration::  Controlling the way Ediff displays things.
* Selective Browsing::          Advanced browsing through difference regions.
* Highlighting Difference Regions::  Controlling highlighting.
* Narrowing::                   Comparing regions, windows, etc.
* Refinement of Difference Regions::  How to control the refinement process.
* Patch and Diff Programs::     Changing the utilities that compute differences
                                and apply patches.
* Merging and diff3::           How to customize Ediff in its Merge Mode.
* Support for Version Control::  Changing the version control package.
                                 You are not likely to do that.
* Customizing the Mode Line::   Changing the look of the mode line in Ediff.
* Miscellaneous::               Other customization.
* Notes on Heavy-duty Customization::  Customization for the gurus.
@end menu

@node Hooks, Quick Help Customization, Customization, Customization
@section Hooks

The bulk of customization can be done via the following hooks:

@table @code
@item ediff-load-hook
@vindex ediff-load-hook
This hook can be used to change defaults after Ediff is loaded.

@item ediff-before-setup-hook
@vindex ediff-before-setup-hook
Hook that is run just before Ediff rearranges windows to its liking.
Can be used to save windows configuration.

@item ediff-keymap-setup-hook
@vindex ediff-keymap-setup-hook
@vindex ediff-mode-map
This hook can be used to alter bindings in Ediff's keymap,
@code{ediff-mode-map}.  These hooks are
run right after the default bindings are set but before
@code{ediff-load-hook}.  The regular user needs not be concerned with this
hook---it is provided for implementors of other Emacs packages built on top
of Ediff.

@item ediff-before-setup-windows-hook
@itemx ediff-after-setup-windows-hook
@vindex ediff-before-setup-windows-hook
@vindex ediff-after-setup-windows-hook
These two hooks are called before and after Ediff sets up its window
configuration.  These hooks are run each time Ediff rearranges windows to
its liking. This happens whenever it detects that the user changed the
windows setup.

@item ediff-suspend-hook
@itemx ediff-quit-hook
@vindex ediff-suspend-hook
@vindex ediff-quit-hook
These two hooks are run when you suspend or quit Ediff.  They can be
used to set desired window configurations, delete files Ediff didn't
want to clean up after exiting, etc.

By default, @code{ediff-quit-hook} holds one hook function,
@code{ediff-cleanup-mess}, which cleans after Ediff, as appropriate in
most cases.  You probably won't want to change it, but you might
want to add other hook functions.

Keep in mind that hooks executing before @code{ediff-cleanup-mess} start
in @code{ediff-control-buffer;} they should also leave
@code{ediff-control-buffer} as the current buffer when they finish.
Hooks that are executed after @code{ediff-cleanup-mess} should expect
the current buffer be either buffer A or buffer B.
@code{ediff-cleanup-mess} doesn't kill the buffers being compared or
merged (see @code{ediff-cleanup-hook}, below).

@item ediff-cleanup-hook
@vindex ediff-cleanup-hook
This hook is run just before @code{ediff-quit-hook}.  This is a good
place to do various cleanups, such as deleting the variant buffers.
Ediff provides a function, @code{ediff-janitor}, as one such possible
hook, which you can add to @code{ediff-cleanup-hook} with
@code{add-hooks}.

@findex ediff-janitor
This function kills buffers A, B, and, possibly, C, if these buffers aren't
modified.  In merge jobs, buffer C is never deleted.  However, the side
effect of using this function is that you may not be able to compare the
same buffer in two separate Ediff sessions: quitting one of them will
delete this buffer in another session as well.

@item ediff-quit-merge-hook
@vindex ediff-quit-merge-hook
@vindex ediff-autostore-merges
@findex ediff-maybe-save-and-delete-merge
This hook is called when Ediff quits a merge job.  By default, the value is
@code{ediff-maybe-save-and-delete-merge}, which is a function that attempts
to save the merge buffer according to the value of
@code{ediff-autostore-merges}, as described later.

@item ediff-before-setup-control-frame-hook
@itemx ediff-after-setup-control-frame-hook
@vindex ediff-before-setup-control-frame-hook
@vindex ediff-after-setup-control-frame-hook
These two hooks run before and after Ediff sets up the control frame.
They can be used to relocate Ediff control frame when Ediff runs in a
multiframe mode (i.e., when the control buffer is in its own dedicated
frame).  Be aware that many variables that drive Ediff are local to
Ediff Control Panel (@code{ediff-control-buffer}), which requires
special care in writing these hooks.  Take a look at
@code{ediff-default-suspend-hook} and @code{ediff-default-quit-hook} to
see what's involved.

@item ediff-startup-hook
@vindex ediff-startup-hook
This hook is run at the end of Ediff startup.

@item ediff-select-hook
@vindex ediff-select-hook
This hook is run after Ediff selects the next difference region.

@item ediff-unselect-hook
@vindex ediff-unselect-hook
This hook is run after Ediff unselects the current difference region.

@item ediff-prepare-buffer-hook
@vindex ediff-prepare-buffer-hook
This hook is run for each Ediff buffer (A, B, C) right after the buffer
is arranged.

@item ediff-display-help-hook
@vindex ediff-display-help-hook
Ediff runs this hook each time after setting up the help message.  It
can be used to alter the help message for custom packages that run on
top of Ediff.

@item ediff-mode-hook
@vindex ediff-mode-hook
This hook is run just after Ediff mode is set up in the control
buffer.  This is done before any Ediff window is created.  You can use it to
set local variables that alter the look of the display.

@item ediff-registry-setup-hook
@vindex ediff-registry-setup-hook
Hooks run after setting up the registry for all active Ediff session.
@xref{Session Groups}, for details.
@item ediff-before-session-group-setup-hook
@vindex ediff-before-session-group-setup-hook
Hooks run before setting up a control panel for a group of related Ediff
sessions. Can be used, for example, to save window configuration to restore
later.
@item ediff-after-session-group-setup-hook
@vindex ediff-after-session-group-setup-hook
Hooks run after setting up a control panel for a group of related Ediff
sessions.  @xref{Session Groups}, for details.
@item ediff-quit-session-group-hook
@vindex ediff-quit-session-group-hook
Hooks run just before exiting a session group.
@item ediff-meta-buffer-keymap-setup-hook
@vindex ediff-meta-buffer-keymap-setup-hook
@vindex ediff-meta-buffer-map
Hooks run just after setting up the @code{ediff-meta-buffer-map} --- the
map that controls key bindings in the meta buffer.  Since
@code{ediff-meta-buffer-map} is a local variable, you can set different
bindings for different kinds of meta buffers.
@end table

@node Quick Help Customization, Window and Frame Configuration, Hooks, Customization
@section Quick Help Customization
@vindex ediff-use-long-help-message
@vindex ediff-control-buffer
@vindex ediff-startup-hook
@vindex ediff-help-message

Ediff provides quick help using its control panel window.  Since this window
takes a fair share of the screen real estate, you can toggle it off by
typing @kbd{?}.  The control window will then shrink to just one line and a
mode line, displaying a short help message.

The variable @code{ediff-use-long-help-message} tells Ediff whether
you use the short message or the long one.  By default, it
is set to @code{nil}, meaning that the short message is used.
Set this to @code{t}, if you want Ediff to use the long
message by default.  This property can always be changed interactively, by
typing @kbd{?} into Ediff Control Buffer.

If you want to change the appearance of the help message on a per-buffer
basis, you must use @code{ediff-startup-hook} to change the value of
the variable @code{ediff-help-message}, which is local to
@code{ediff-control-buffer}.

@node Window and Frame Configuration, Selective Browsing, Quick Help Customization, Customization
@section Window and Frame Configuration

On a non-windowing display, Ediff sets things up in one frame, splitting
it between a small control window and the windows for buffers A, B, and C.
The split between these windows can be horizontal or
vertical, which can be changed interactively by typing @kbd{|} while the
cursor is in the control window.

On a window display, Ediff sets up a dedicated frame for Ediff Control
Panel and then it chooses windows as follows: If one of the buffers
is invisible, it is displayed in the currently selected frame.  If
a buffer is visible, it is displayed in the frame where it is visible.
If, according to the above criteria, the two buffers fall into the same
frame, then so be it---the frame will be shared by the two.  The same
algorithm works when you type @kbd{C-l} (@code{ediff-recenter}), @kbd{p}
(@code{ediff-previous-difference}), @kbd{n}
(@code{ediff-next-difference}), etc.

The above behavior also depends on whether the current frame is splittable,
dedicated, etc.  Unfortunately, the margin of this book is too narrow to
present the details of this remarkable algorithm.

The upshot of all this is that you can compare buffers in one frame or
in different frames.  The former is done by default, while the latter can
be achieved by arranging buffers A, B (and C, if applicable) to be seen in
different frames.  Ediff respects these arrangements, automatically
adapting itself to the multi-frame mode.

Ediff uses the following variables to set up its control panel
(a.k.a.@: control buffer, a.k.a.@: quick help window):

@table @code
@item ediff-control-frame-parameters
@vindex ediff-control-frame-parameters
You can change or augment this variable including the font, color,
etc.  The X resource name of Ediff Control Panel frames is @samp{Ediff}.  Under
X-windows, you can use this name to set up preferences in your
@file{~/.Xdefaults}, @file{~/.xrdb}, or whatever X resource file is in
use.  Usually this is preferable to changing
@code{ediff-control-frame-parameters} directly.  For instance, you can
specify in @file{~/.Xdefaults} the color of the control frame
using the resource @samp{Ediff*background}.

In general, any X resource pertaining the control frame can be reached
via the prefix @code{Ediff*}.

@item ediff-control-frame-position-function
@vindex ediff-control-frame-position-function
The preferred way of specifying the position of the control frame is by
setting the variable @code{ediff-control-frame-position-function} to an
appropriate function.
The default value of this variable is
@code{ediff-make-frame-position}.  This function places the control frame in
the vicinity of the North-East corner of the frame displaying buffer A.

@findex ediff-make-frame-position
@end table

The following variables can be used to adjust the location produced by
@code{ediff-make-frame-position} and for related customization.

@table @code
@item ediff-narrow-control-frame-leftward-shift
@vindex ediff-narrow-control-frame-leftward-shift
Specifies the number of characters for shifting
the control frame from the rightmost edge of frame A when the control
frame is displayed as a small window.

@item ediff-wide-control-frame-rightward-shift
@vindex ediff-wide-control-frame-rightward-shift
Specifies the rightward shift of the control frame
from the left edge of frame A when the control frame shows the full
menu of options.

@item ediff-control-frame-upward-shift
@vindex ediff-control-frame-upward-shift
Specifies the number of pixels for the upward shift
of the control frame.

@item ediff-prefer-iconified-control-frame
@vindex ediff-prefer-iconified-control-frame
If this variable is @code{t}, the control frame becomes iconified
automatically when you toggle the quick help message off.  This saves
valuable real estate on the screen.  Toggling help back will deiconify
the control frame.

To start Ediff with an iconified Control Panel, you should set this
variable to @code{t} and @code{ediff-prefer-long-help-message} to
@code{nil} (@pxref{Quick Help Customization}).  This behavior is useful
only if icons are allowed to accept keyboard input (which depends on the
window manager and other factors).
@end table

@findex ediff-setup-windows
To make more creative changes in the way Ediff sets up windows, you can
rewrite the function @code{ediff-setup-windows}.  However, we believe
that detaching Ediff Control Panel from the rest and making it into a
separate frame offers an important opportunity by allowing you to
iconify that frame.  The icon will usually accept all of the Ediff
commands, but will free up valuable real estate on your screen (this may
depend on your window manager, though).

The following variable controls how windows are set up:

@table @code
@item ediff-window-setup-function
@vindex ediff-window-setup-function
The multiframe setup is done by the
@code{ediff-setup-windows-multiframe} function, which is the default on
windowing displays.  The plain setup, one where all windows are always
in one frame, is done by @code{ediff-setup-windows-plain}, which is the
default on a non-windowing display (or in an xterm window).  In fact,
under Emacs, you can switch freely between these two setups by executing
the command @code{ediff-toggle-multiframe} using the Minibuffer of the
Menubar.
@findex ediff-setup-windows-multiframe
@findex ediff-setup-windows-plain
@findex ediff-toggle-multiframe

If you don't like any of these setups, write your own function.  See the
documentation for @code{ediff-window-setup-function} for the basic
guidelines.  However, writing window setups is not easy, so you should
first take a close look at @code{ediff-setup-windows-plain} and
@code{ediff-setup-windows-multiframe}.
@end table

You can run multiple Ediff sessions at once, by invoking Ediff several
times without exiting previous Ediff sessions.  Different sessions
may even operate on the same pair of files.

Each session has its own Ediff Control Panel and all the regarding a
particular session is local to the associated control panel buffer.  You
can switch between sessions by suspending one session and then switching
to another control panel.  (Different control panel buffers are
distinguished by a numerical suffix, e.g., @samp{Ediff Control Panel<3>}.)

@node Selective Browsing, Highlighting Difference Regions, Window and Frame Configuration, Customization
@section Selective Browsing

Sometimes it is convenient to be able to step through only some difference
regions, those that match certain regular expressions, and to ignore all
others.  On other occasions, you may want to ignore difference regions that
match some regular expressions, and to look only at the rest.

The commands @kbd{#f} and @kbd{#h} let you do precisely this.

Typing @kbd{#f} lets you specify regular expressions that match difference
regions you want to focus on.
We shall call these regular expressions @var{regexp-A}, @var{regexp-B} and
@var{regexp-C}.
Ediff will then start stepping through only those difference regions
where the region in buffer A matches @var{regexp-A} and/or the region in
buffer B matches @var{regexp-B}, etc.  Whether `and' or `or' will be used
depends on how you respond to a question.

When scanning difference regions for the aforesaid regular expressions,
Ediff narrows the buffers to those regions.  This means that you can use
the expressions @kbd{\`} and @kbd{\'} to tie search to the beginning or end
of the difference regions.

On the other hand, typing @kbd{#h} lets you specify (hide) uninteresting
regions.  That is, if a difference region in buffer A matches
@var{regexp-A}, the corresponding region in buffer B matches @var{regexp-B}
and (if applicable) buffer C's region matches @var{regexp-C}, then the
region will be ignored by the commands @kbd{n}/@key{SPC}
(@code{ediff-next-difference}) and @kbd{p}/@key{DEL}
(@code{ediff-previous-difference}) commands.

Typing @kbd{#f} and @kbd{#h} toggles selective browsing on and off.

Note that selective browsing affects only @code{ediff-next-difference}
and @code{ediff-previous-difference}, i.e., the commands
@kbd{n}/@key{SPC} and @kbd{p}/@key{DEL}.  @kbd{#f} and @kbd{#h} do not
change the position of the point in the buffers.  And you can still jump
directly (using @kbd{j})  to any numbered
difference.

Users can supply their own functions to specify how Ediff should do
selective browsing.  To change the default Ediff function, add a function to
@code{ediff-load-hook} which will do the following assignments:

@example
(setq ediff-hide-regexp-matches-function 'your-hide-function)
(setq ediff-focus-on-regexp-matches-function 'your-focus-function)
@end example

@strong{Useful hint}: To specify a regexp that matches everything, don't
simply type @key{RET} in response to a prompt.  Typing @key{RET} tells Ediff
to accept the default value, which may not be what you want.  Instead, you
should enter something like @key{^} or @key{$}.  These match every
line.

You can use the status command, @kbd{i}, to find out whether
selective browsing is currently in effect.

The regular expressions you specified are kept in the local variables
@code{ediff-regexp-focus-A}, @code{ediff-regexp-focus-B},
@code{ediff-regexp-focus-C}, @code{ediff-regexp-hide-A},
@code{ediff-regexp-hide-B}, @code{ediff-regexp-hide-C}.  Their default value
is the empty string (i.e., nothing is hidden or focused on).  To change the
default, set these variables in @file{.emacs} using @code{setq-default}.

In addition to the ability to ignore regions that match regular
expressions, Ediff can be ordered to start skipping over certain
``uninteresting'' difference regions.  This is controlled by the following
variable:

@table @code
@item ediff-ignore-similar-regions
@vindex ediff-ignore-similar-regions
If @code{t}, causes Ediff to skip over "uninteresting" difference regions,
which are the regions where the variants differ only in the amount of the
white space and newlines.  This feature can be toggled on/off interactively,
via the command @kbd{##}.
@end table

@strong{Please note:} in order for this feature to work, auto-refining of
difference regions must be on, since otherwise Ediff won't know if there
are fine differences between regions.  On devices where Emacs can display
faces, auto-refining is a default, but it is not turned on by default on
text-only terminals.  In that case, you must explicitly turn auto-refining
on (such as, by typing @kbd{@@}).

@strong{Reassurance:} If many such uninteresting regions appear in a row,
Ediff may take a long time to skip over them because it has to compute fine
differences of all intermediate regions.  This delay does not indicate any
problem.

@vindex ediff-ignore-case-option
@vindex ediff-ignore-case-option3
@vindex ediff-ignore-case
Finally, Ediff can be told to ignore the case of the letters. This behavior
can be toggled with @kbd{#c} and it is controlled with three variables:
@code{ediff-ignore-case-option}, @code{ediff-ignore-case-option3}, and
@code{ediff-ignore-case}.

The variable @code{ediff-ignore-case-option} specifies the option to pass
to the diff program for comparing two files or buffers. For GNU
@code{diff}, this option is @code{"-i"}. The variable
@code{ediff-ignore-case-option3} specifies the option to pass to the
@code{diff3} program in order to make it case-insensitive. GNU @code{diff3}
does not have such an option, so when merging or comparing three files with
this program, ignoring the letter case is not supported.

The variable @code{ediff-ignore-case} controls whether Ediff starts out by
ignoring letter case or not. It can be set in @file{.emacs} using
@code{setq-default}.

When case sensitivity is toggled, all difference
regions are recomputed.

@node Highlighting Difference Regions, Narrowing, Selective Browsing, Customization
@section Highlighting Difference Regions

The following variables control the way Ediff highlights difference
regions:

@table @code
@item ediff-before-flag-bol
@itemx ediff-after-flag-eol
@itemx ediff-before-flag-mol
@itemx ediff-after-flag-mol
@vindex ediff-before-flag-bol
@vindex ediff-after-flag-eol
@vindex ediff-before-flag-mol
@vindex ediff-after-flag-mol
These variables hold strings that Ediff uses to mark the beginning and the
end of the differences found in files A, B, and C on devices where Emacs
cannot display faces.  Ediff uses different flags to highlight regions that
begin/end at the beginning/end of a line or in a middle of a line.

@item ediff-current-diff-face-A
@itemx ediff-current-diff-face-B
@itemx ediff-current-diff-face-C
@vindex ediff-current-diff-face-A
@vindex ediff-current-diff-face-B
@vindex ediff-current-diff-face-C
Ediff uses these faces to highlight current differences on devices where
Emacs can display faces.  These and subsequently described faces can be set
either in @file{.emacs} or in @file{.Xdefaults}.  The X resource for Ediff
is @samp{Ediff}, @emph{not} @samp{emacs}.  Please refer to Emacs manual for
the information on how to set X resources.
@item ediff-fine-diff-face-A
@itemx ediff-fine-diff-face-B
@itemx ediff-fine-diff-face-C
@vindex ediff-fine-diff-face-A
@vindex ediff-fine-diff-face-B
@vindex ediff-fine-diff-face-C
Ediff uses these faces to show the fine differences between the current
differences regions in buffers A, B, and C, respectively.

@item ediff-even-diff-face-A
@itemx ediff-even-diff-face-B
@itemx ediff-even-diff-face-C
@itemx ediff-odd-diff-face-A
@itemx ediff-odd-diff-face-B
@itemx ediff-odd-diff-face-C
@vindex ediff-even-diff-face-A
@vindex ediff-even-diff-face-B
@vindex ediff-even-diff-face-C
@vindex ediff-odd-diff-face-A
@vindex ediff-odd-diff-face-B
@vindex ediff-odd-diff-face-C
Non-current difference regions are displayed using these alternating
faces.  The odd and the even faces are actually identical on monochrome
displays, because without colors options are limited.
So, Ediff uses italics to highlight non-current differences.

@item ediff-force-faces
@vindex ediff-force-faces
Ediff generally can detect when Emacs is running on a device where it can
use highlighting with faces.  However, if it fails to determine that faces
can be used, the user can set this variable to @code{t} to make sure that
Ediff uses faces to highlight differences.

@item ediff-highlight-all-diffs
@vindex ediff-highlight-all-diffs
Indicates whether---on a windowing display---Ediff should highlight
differences using inserted strings (as on text-only terminals) or using
colors and highlighting.  Normally, Ediff highlights all differences, but
the selected difference is highlighted more visibly.  One can cycle through
various modes of highlighting by typing @kbd{h}.  By default, Ediff starts
in the mode where all difference regions are highlighted.  If you prefer to
start in the mode where unselected differences are not highlighted, you
should set @code{ediff-highlight-all-diffs} to @code{nil}.  Type @kbd{h} to
restore highlighting for all differences.

Ediff lets you switch between the two modes of highlighting.  That is,
you can switch interactively from highlighting using faces to
highlighting using string flags, and back.  Of course, switching has
effect only under a windowing system.  On a text-only terminal or in an
xterm window, the only available option is highlighting with strings.
@end table

@noindent
If you want to change the default settings for @code{ediff-force-faces} and
@code{ediff-highlight-all-diffs}, you must do it @strong{before} Ediff is
loaded.

You can also change the defaults for the faces used to highlight the
difference regions.  There are two ways to do this.  The simplest and the
preferred way is to use the customization widget accessible from the
menubar.  Ediff's customization group is located under "Tools", which in
turn is under "Programming".  The faces that are used to highlight
difference regions are located in the "Highlighting" subgroup of the Ediff
customization group.

The second, much more arcane, method to change default faces is to include
some Lisp code in @file{~/.emacs}.  For instance,

@example
(setq ediff-current-diff-face-A
      (copy-face 'bold-italic 'ediff-current-diff-face-A))
@end example

@noindent
would use the pre-defined face @code{bold-italic} to highlight the current
difference region in buffer A (this face is not a good choice, by the way).

If you are unhappy with just @emph{some} of the aspects of the default
faces, you can modify them when Ediff is being loaded using
@code{ediff-load-hook}.  For instance:

@smallexample
(add-hook 'ediff-load-hook
          (lambda ()
            (set-face-foreground
              ediff-current-diff-face-B "blue")
            (set-face-background
              ediff-current-diff-face-B "red")
            (make-face-italic
              ediff-current-diff-face-B)))
@end smallexample

@strong{Please note:} to set Ediff's faces, use only @code{copy-face}
or @code{set/make-face-@dots{}} as shown above. Emacs' low-level
face-manipulation functions should be avoided.

@node Narrowing, Refinement of Difference Regions, Highlighting Difference Regions, Customization
@section Narrowing

If buffers being compared are narrowed at the time of invocation of
Ediff, @code{ediff-buffers} will preserve the narrowing range.  However,
if @code{ediff-files} is invoked on the files visited by these buffers,
that would widen the buffers, since this command is defined to compare the
entire files.

Calling @code{ediff-regions-linewise} or @code{ediff-windows-linewise}, or
the corresponding @samp{-wordwise} commands, narrows the variants to the
particular regions being compared.  The original accessible ranges are
restored when you quit Ediff.  During the command, you can toggle this
narrowing on and off with the @kbd{%} command.

These two variables control this narrowing behavior:

@table @code
@item ediff-start-narrowed
@vindex ediff-start-narrowed
If @code{t}, Ediff narrows the display to the appropriate range when it
is invoked with an @samp{ediff-regions@dots{}} or
@samp{ediff-windows@dots{}} command.  If @code{nil}, these commands do
not automatically narrow, but you can still toggle narrowing on and off
by typing @kbd{%}.

@item ediff-quit-widened
@vindex ediff-quit-widened
Controls whether on quitting Ediff should restore the accessible range
that existed before the current invocation.
@end table

@node Refinement of Difference Regions, Patch and Diff Programs, Narrowing, Customization
@section Refinement of Difference Regions

Ediff has variables to control the way fine differences are
highlighted.  This feature gives you control over the process of refinement.
Note that refinement ignores spaces, tabs, and newlines.

@table @code
@item ediff-auto-refine
@vindex ediff-auto-refine
This variable controls whether fine differences within regions are
highlighted automatically (``auto-refining'').  The default is yes
(@samp{on}).

On a slow machine, automatic refinement may be painful.  In that case,
you can turn auto-refining on or off interactively by typing
@kbd{@@}.  You can also turn off display of refining that has
already been done.

When auto-refining is off, fine differences are shown only for regions
for which these differences have been computed and saved before.  If
auto-refining and display of refining are both turned off, fine
differences are not shown at all.

Typing @kbd{*} computes and displays fine differences for the current
difference region, regardless of whether auto-refining is turned on.

@item ediff-auto-refine-limit
@vindex ediff-auto-refine-limit
If auto-refining is on, this variable limits the size of the regions to
be auto-refined.  This guards against the possible slowdown that may be
caused by extraordinary large difference regions.

You can always refine the current region by typing @kbd{*}.

@item ediff-forward-word-function
@vindex ediff-forward-word-function
This variable controls how fine differences are computed.  The
value must be a Lisp function that determines how the current difference
region should be split into words.

@vindex ediff-diff-program
@vindex ediff-forward-word-function
@findex ediff-forward-word
Fine differences are computed by first splitting the current difference
region into words and then passing the result to
@code{ediff-diff-program}.  For the default forward word function (which is
@code{ediff-forward-word}), a word is a string consisting of letters,
@samp{-}, or @samp{_}; a string of punctuation symbols; a string of digits,
or a string consisting of symbols that are neither space, nor a letter.

This default behavior is controlled by four variables: @code{ediff-word-1},
..., @code{ediff-word-4}.  See the on-line documentation for these variables
and for the function @code{ediff-forward-word} for an explanation of how to
modify these variables.
@vindex ediff-word-1
@vindex ediff-word-2
@vindex ediff-word-3
@vindex ediff-word-4
@end table

Sometimes, when a region has too many differences between the variants,
highlighting of fine differences is inconvenient, especially on
color displays.  If that is the case, type @kbd{*} with a negative
prefix argument.  This unhighlights fine differences for the current
region.

To unhighlight fine differences in all difference regions, use the
command @kbd{@@}.  Repeated typing of this key cycles through three
different states: auto-refining, no-auto-refining, and no-highlighting
of fine differences.

@node Patch and Diff Programs, Merging and diff3, Refinement of Difference Regions, Customization
@section Patch and Diff Programs

This section describes variables that specify the programs to be used for
applying patches and for computing the main difference regions (not the
fine difference regions):

@table @code
@item ediff-diff-program
@itemx ediff-diff3-program
@vindex ediff-patch-program
@vindex ediff-diff-program
@vindex ediff-diff3-program
These variables specify the programs to use to produce differences
and do patching.

@item ediff-diff-options
@itemx ediff-diff3-options
@vindex ediff-patch-options
@vindex ediff-diff-options
@vindex ediff-diff3-options
These variables specify the options to pass to the above utilities.

In @code{ediff-diff-options}, it may be useful to specify options
such as @samp{-w} that ignore certain kinds of changes.  However,
Ediff does not let you use the option @samp{-c}, as it doesn't recognize this
format yet.

@item ediff-coding-system-for-read
@vindex ediff-coding-system-for-read
This variable specifies the coding system to use when reading the output
that the programs @code{diff3} and @code{diff} send to Emacs. The default
is @code{raw-text}, and this should work fine in Unix and in most
cases under Windows NT/95/98/2000. There are @code{diff} programs
for which the default option doesn't work under Windows. In such cases,
@code{raw-text-dos} might work. If not, you will have to experiment with
other coding systems or use GNU diff.

@item ediff-patch-program
The program to use to apply patches.  Since there are certain
incompatibilities between the different versions of the patch program, the
best way to stay out of trouble is to use a GNU-compatible version.
Otherwise, you may have to tune the values of the variables
@code{ediff-patch-options}, @code{ediff-backup-specs}, and
@code{ediff-backup-extension} as described below.
@item ediff-patch-options
Options to pass to @code{ediff-patch-program}.

Note: the `-b' and `-z' options should be specified in
`ediff-backup-specs', not in @code{ediff-patch-options}.

It is recommended to pass the `-f' option to the patch program, so it won't
ask questions.  However, some implementations don't accept this option, in
which case the default value of this variable should be changed.

@item ediff-backup-extension
Backup extension used by the patch program.  Must be specified, even if
@code{ediff-backup-specs} is given.
@item ediff-backup-specs
Backup directives to pass to the patch program.
Ediff requires that the old version of the file (before applying the patch)
is saved in a file named @file{the-patch-file.extension}.  Usually
`extension' is `.orig', but this can be changed by the user, and may also be
system-dependent.  Therefore, Ediff needs to know the backup extension used
by the patch program.

Some versions of the patch program let the user specify `-b backup-extension'.
Other versions only permit `-b', which (usually) assumes the extension `.orig'.
Yet others force you to use `-z<backup-extension>'.

Note that both `ediff-backup-extension' and `ediff-backup-specs' must be
properly set.  If your patch program takes the option `-b', but not
`-b extension', the variable `ediff-backup-extension' must still
be set so Ediff will know which extension to use.

@item ediff-custom-diff-program
@itemx ediff-custom-diff-options
@vindex ediff-custom-diff-program
@vindex ediff-custom-diff-options
@findex ediff-save-buffer
Because Ediff limits the options you may want to pass to the @code{diff}
program, it partially makes up for this drawback by letting you save the
output from @code{diff} in your preferred format, which is specified via
the above two variables.

The output generated by @code{ediff-custom-diff-program} (which doesn't
even have to be a standard-style @code{diff}!)@: is not used by Ediff.  It is
provided exclusively so that you can
refer to
it later, send it over email, etc.  For instance, after reviewing the
differences, you may want to send context differences to a colleague.
Since Ediff ignores the @samp{-c} option in
@code{ediff-diff-program}, you would have to run @code{diff -c} separately
just to produce the list of differences.  Fortunately,
@code{ediff-custom-diff-program} and @code{ediff-custom-diff-options}
eliminate this nuisance by keeping a copy of a difference list in the
desired format in a buffer that can be displayed via the command @kbd{D}.

@item ediff-patch-default-directory
@vindex ediff-patch-default-directory
Specifies the default directory to look for patches.

@end table

@noindent
@strong{Warning:} Ediff does not support the output format of VMS
@code{diff}.  Instead, make sure you are using some implementation of POSIX
@code{diff}, such as @code{gnudiff}.

@node Merging and diff3, Support for Version Control, Patch and Diff Programs, Customization
@section Merging and diff3

Ediff supports three-way comparison via the functions @code{ediff-files3} and
@code{ediff-buffers3}.  The interface is the same as for two-way comparison.
In three-way comparison and merging, Ediff reports if any two difference
regions are identical.  For instance, if the current region in buffer A
is the same as the region in buffer C, then the mode line of buffer A will
display @samp{[=diff(C)]} and the mode line of buffer C will display
@samp{[=diff(A)]}.

Merging is done according to the following algorithm.

If a difference region in one of the buffers, say B, differs from the ancestor
file while the region in the other buffer, A, doesn't, then the merge buffer,
C, gets B's region.  Similarly when buffer A's region differs from
the ancestor and B's doesn't, A's region is used.

@vindex ediff-default-variant
If both regions in buffers A and B differ from the ancestor file, Ediff
chooses the region according to the value of the variable
@code{ediff-default-variant}.  If its value is @code{default-A} then A's
region is chosen.  If it is @code{default-B} then B's region is chosen.
If it is @code{combined} then the region in buffer C will look like
this:

@comment Use @set to avoid triggering merge conflict detectors like CVS.
@set seven-left <<<<<<<
@set seven-right >>>>>>>
@example
@value{seven-left} variant A
the difference region from buffer A
@value{seven-right} variant B
the difference region from buffer B
####### Ancestor
the difference region from the ancestor buffer, if available
======= end
@end example

The above is the default template for the combined region. The user can
customize this template using the variable
@code{ediff-combination-pattern}.

@vindex ediff-combination-pattern
The variable @code{ediff-combination-pattern} specifies the template that
determines how the combined merged region looks like.  The template is
represented as a list of the form @code{(STRING1 Symbol1 STRING2 Symbol2
STRING3 Symbol3 STRING4)}. The symbols here must be atoms of the form
@code{A}, @code{B}, or @code{Ancestor}. They determine the order in which
the corresponding difference regions (from buffers A, B, and the ancestor
buffer) are displayed in the merged region of buffer C.  The strings in the
template determine the text that separates the aforesaid regions. The
default template is

@smallexample
("@value{seven-left} variant A" A "@value{seven-right} variant B" B
   "####### Ancestor" Ancestor "======= end")
@end smallexample

@noindent
(this is one long line) and the corresponding combined region is shown
above. The order in which the regions are shown (and the separator
strings) can be changed by changing the above template. It is even
possible to add or delete region specifiers in this template (although
the only possibly useful such modification seems to be the deletion of
the ancestor).

In addition to the state of the difference, Ediff displays the state of the
merge for each region.  If a difference came from buffer A by default
(because both regions A and B were different from the ancestor and
@code{ediff-default-variant} was set to @code{default-A}) then
@samp{[=diff(A) default-A]} is displayed in the mode line.  If the
difference in buffer C came, say, from buffer B because the difference
region in that buffer differs from the ancestor, but the region in buffer A
does not (if merging with an ancestor) then @samp{[=diff(B) prefer-B]} is
displayed.  The indicators default-A/B and prefer-A/B are inspired by
Emerge and have the same meaning.

Another indicator of the state of merge is @samp{combined}.  It appears
with any difference region in buffer C that was obtained by combining
the difference regions in buffers A and B as explained above.

In addition to the state of merge and state of difference indicators, while
merging with an ancestor file or buffer, Ediff informs the user when the
current difference region in the (normally invisible) ancestor buffer is
empty via the @emph{AncestorEmpty} indicator.  This helps determine if the
changes made to the original in variants A and B represent pure insertion
or deletion of text: if the mode line shows @emph{AncestorEmpty} and the
corresponding region in buffers A or B is not empty, this means that new
text was inserted.  If this indicator is not present and the difference
regions in buffers A or B are non-empty, this means that text was
modified.  Otherwise, the original text was deleted.

Although the ancestor buffer is normally invisible, Ediff maintains
difference regions there and advances the current difference region
accordingly.  All highlighting of difference regions is provided in the
ancestor buffer, except for the fine differences.  Therefore, if desired, the
user can put the ancestor buffer in a separate frame and watch it
there.  However, on a TTY, only one frame can be visible at any given time,
and Ediff doesn't support any single-frame window configuration where all
buffers, including the ancestor buffer, would be visible.  However, the
ancestor buffer can be displayed by typing @kbd{/} to the control
window.  (Type @kbd{C-l} to hide it again.)

Note that the state-of-difference indicators @samp{=diff(A)} and
@samp{=diff(B)} above are not redundant, even in the presence of a
state-of-merge indicator.  In fact, the two serve different purposes.

For instance, if the mode line displays @samp{=diff(B) prefer(B)} and
you copy a difference region from buffer A to buffer C then
@samp{=diff(B)} will change to @samp{diff-A} and the mode line will
display @samp{=diff(A) prefer-B}.  This indicates that the difference
region in buffer C is identical to that in buffer A, but originally
buffer C's region came from buffer B.  This is useful to know because
you can recover the original difference region in buffer C by typing
@kbd{r}.


Ediff never changes the state-of-merge indicator, except in response to
the @kbd{!} command (see below), in which case the indicator is lost.
On the other hand, the state-of-difference indicator is changed
automatically by the copying/recovery commands, @kbd{a}, @kbd{b}, @kbd{r},
@kbd{+}.

The @kbd{!} command loses the information about origins of the regions
in the merge buffer (default-A, prefer-B, or combined).  This is because
recomputing differences in this case means running @code{diff3} on
buffers A, B, and the merge buffer, not on the ancestor buffer.  (It
makes no sense to recompute differences using the ancestor file, since
in the merging mode Ediff assumes that you have not edited buffers A and
B, but that you may have edited buffer C, and these changes are to be
preserved.)  Since some difference regions may disappear as a result of
editing buffer C and others may arise, there is generally no simple way
to tell where the various regions in the merge buffer came from.

In three-way comparison, Ediff tries to disregard regions that consist
entirely of white space.  For instance, if, say, the current region in
buffer A consists of the white space only (or if it is empty), Ediff will
not take it into account for the purpose of computing fine differences.  The
result is that Ediff can provide a better visual information regarding the
actual fine differences in the non-white regions in buffers B and
C.  Moreover, if the regions in buffers B and C differ in the white space
only, then a message to this effect will be displayed.

@vindex ediff-merge-window-share
In the merge mode, the share of the split between window C (the window
displaying the merge-buffer) and the windows displaying buffers A and B
is controlled by the variable @code{ediff-merge-window-share}.  Its
default value is 0.5.  To make the merge-buffer window smaller, reduce
this amount.

We don't recommend increasing the size of the merge-window to more than
half the frame (i.e., to increase the value of
@code{ediff-merge-window-share}) to more than 0.5, since it would be
hard to see the contents of buffers A and B.

You can temporarily shrink the merge window to just one line by
typing @kbd{s}.  This change is temporary, until Ediff finds a reason to
redraw the screen.  Typing @kbd{s} again restores the original window size.

With a positive prefix argument, the @kbd{s} command will make the merge
window slightly taller.  This change is persistent.  With `@kbd{-}' or
with a negative prefix argument, the command @kbd{s} makes the merge
window slightly shorter.  This change also persistent.

@vindex ediff-show-clashes-only
Ediff lets you automatically ignore the regions where only one of the
buffers A and B disagrees with the ancestor.  To do this, set the
variable @code{ediff-show-clashes-only} to non-@code{nil}.

You can toggle this feature interactively by typing @kbd{$$}.

Note that this variable affects only the show next/previous difference
commands.  You can still jump directly to any difference region directly
using the command @kbd{j} (with a prefix argument specifying the difference
number).

@vindex ediff-autostore-merges
@vindex ediff-quit-merge-hook
@findex ediff-maybe-save-and-delete-merge
The variable @code{ediff-autostore-merges} controls what happens to the
merge buffer when Ediff quits.  If the value is @code{nil}, nothing is done
to the merge buffer---it will be the user's responsibility to save it.
If the value is @code{t}, the user will be asked where to save the buffer
and whether to delete it afterwards.  It the value is neither @code{nil} nor
@code{t}, the merge buffer is saved @emph{only} if this merge session was
invoked from a group of related Ediff session, such as those that result
from @code{ediff-merge-directories},
@code{ediff-merge-directory-revisions}, etc.
@xref{Session Groups}.  This behavior is implemented in the function
@code{ediff-maybe-save-and-delete-merge}, which is a hook in
@code{ediff-quit-merge-hook}.  The user can supply a different hook, if
necessary.

The variable @code{ediff-autostore-merges} is buffer-local, so it can be
set in a per-buffer manner.  Therefore, use @code{setq-default} to globally
change this variable.

@vindex ediff-merge-filename-prefix
When merge buffers are saved automatically as directed by
@code{ediff-autostore-merges}, Ediff attaches a prefix to each file, as
specified by the variable @code{ediff-merge-filename-prefix}. The default
is @code{merge_}, but this can be changed by the user.

@node Support for Version Control, Customizing the Mode Line, Merging and diff3, Customization
@section Support for Version Control


Ediff supports version control and lets you compare versions of files
visited by Emacs buffers via the function @code{ediff-revision}.  This
feature is controlled by the following variables:

@table @code
@item ediff-version-control-package
@vindex ediff-version-control-package
A symbol.  The default is @samp{vc}.

If you are like most Emacs users, Ediff will use VC as the version control
package.  This is the standard Emacs interface to RCS, CVS, and SCCS.

However, if your needs are better served by other interfaces, you will
have to tell Ediff which version control package you are using, e.g.,
@example
(setq ediff-version-control-package 'rcs)
@end example

Apart from the standard @file{vc.el}, Ediff supports three other interfaces
to version control: @file{rcs.el}, @file{pcl-cvs.el} (recently renamed
pcvs.el), and @file{generic-sc.el}.  The package @file{rcs.el} is written
by Sebastian Kremer <sk@@thp.Uni-Koeln.DE> and is available as
@example
@file{ftp.cs.buffalo.edu:pub/Emacs/rcs.tar.Z}
@file{ftp.uni-koeln.de:/pub/gnu/emacs/rcs.tar.Z}
@end example
@pindex @file{vc.el}
@pindex @file{rcs.el}
@pindex @file{pcl-cvs.el}
@pindex @file{generic-sc.el}
@end table

Ediff's interface to the above packages allows the user to compare the
versions of the current buffer or to merge them (with or without an
ancestor-version).  These operations can also be performed on directories
containing files under version control.

In case of @file{pcl-cvs.el}, Ediff can also be invoked via the function
@code{run-ediff-from-cvs-buffer}---see the documentation string for this
function.

@node Customizing the Mode Line, Miscellaneous, Support for Version Control, Customization
@section Customizing the Mode Line

When Ediff is running, the mode line of @samp{Ediff Control Panel}
buffer shows the current difference number and the total number of
difference regions in the two files.

The mode line of the buffers being compared displays the type of the
buffer (@samp{A:}, @samp{B:}, or @samp{C:}) and (usually) the file name.
Ediff tries to be intelligent in choosing the mode line buffer
identification.  In particular, it works well with the
@file{uniquify.el} and @file{mode-line.el} packages (which improve on
the default way in which Emacs displays buffer identification).  If you
don't like the way Ediff changes the mode line, you can use
@code{ediff-prepare-buffer-hook} to modify the mode line.
@vindex ediff-prepare-buffer-hook
@pindex @file{uniquify.el}
@pindex @file{mode-line.el}

@node Miscellaneous, Notes on Heavy-duty Customization, Customizing the Mode Line, Customization
@section Miscellaneous

Here are a few other variables for customizing Ediff:

@table @code
@item ediff-split-window-function
@vindex ediff-split-window-function
Controls the way you want the window be split between file-A and file-B
(and file-C, if applicable).  It defaults to the vertical split
(@code{split-window-vertically}, but you can set it to
@code{split-window-horizontally}, if you so wish.
Ediff also lets you switch from vertical to horizontal split and back
interactively.

Note that if Ediff detects that all the buffers it compares are displayed in
separate frames, it assumes that the user wants them to be so displayed
and stops splitting windows.  Instead, it arranges for each buffer to
be displayed in a separate frame.  You can switch to the one-frame mode
by hiding one of the buffers A/B/C.

You can also swap the windows where buffers are displayed by typing
@kbd{~}.

@item ediff-merge-split-window-function
@vindex ediff-merge-split-window-function
Controls how windows are
split between buffers A and B in the merge mode.
This variable is like @code{ediff-split-window-function}, but it defaults
to @code{split-window-horizontally} instead of
@code{split-window-vertically}.

@item ediff-make-wide-display-function
@vindex ediff-make-wide-display-function
The value is a function to be called to widen the frame for displaying
the Ediff buffers.  See the on-line documentation for
@code{ediff-make-wide-display-function} for details.  It is also
recommended to look into the source of the default function
@code{ediff-make-wide-display}.

You can toggle wide/regular display by typing @kbd{m}.  In the wide
display mode, buffers A, B (and C, when applicable) are displayed in a
single frame that is as wide as the entire workstation screen.  This is
useful when files are compared side-by-side.  By default, the display is
widened without changing its height.

@item ediff-use-last-dir
@vindex ediff-use-last-dir
Controls the way Ediff presents the
default directory when it prompts the user for files to compare.  If
@code{nil},
Ediff uses the default directory of the current buffer when it
prompts the user for file names.  Otherwise, it will use the
directories it had previously used for files A, B, or C, respectively.

@item ediff-no-emacs-help-in-control-buffer
@vindex ediff-no-emacs-help-in-control-buffer
If @code{t}, makes @kbd{C-h}
behave like the @key{DEL} key, i.e., it will move you back to the previous
difference rather than invoking help.  This is useful when, in an xterm
window or a text-only terminal, the Backspace key is bound to @kbd{C-h} and is
positioned more conveniently than the @key{DEL} key.

@item ediff-toggle-read-only-function
@vindex ediff-toggle-read-only-function
This variable's value is a function that Ediff uses to toggle
the read-only property in its buffers.

The default function that Ediff uses simply toggles the read-only property,
unless the file is under version control.  For a checked-in file under
version control, Ediff first tries to check the file out.

@item ediff-make-buffers-readonly-at-startup nil
@vindex ediff-make-buffers-readonly-at-startup
If @code{t}, all variant buffers are made read-only at Ediff startup.

@item ediff-keep-variants
@vindex @code{ediff-keep-variants}
The default is @code{t}, meaning that the buffers being compared or merged will
be preserved when Ediff quits.  Setting this to @code{nil} causes Ediff to
offer the user a chance to delete these buffers (if they are not modified).
Supplying a prefix argument to the quit command (@code{q}) temporarily
reverses the meaning of this variable.  This is convenient when the user
prefers one of the behaviors most of the time, but occasionally needs the
other behavior.

However, Ediff temporarily resets this variable to @code{t} if it is
invoked via one of the "buffer" jobs, such as @code{ediff-buffers}.
This is because it is all too easy to loose day's work otherwise.
Besides, in a "buffer" job, the variant buffers have already been loaded
prior to starting Ediff, so Ediff just preserves status quo here.

Using @code{ediff-cleanup-hook}, one can make Ediff delete the variants
unconditionally (e.g., by making @code{ediff-janitor} into one of these hooks).

@item ediff-keep-tmp-versions
@vindex @code{ediff-keep-tmp-versions}
Default is @code{nil}. If @code{t}, the versions of the files being
compared or merged using operations such as @code{ediff-revision} or
@code{ediff-merge-revisions} are not deleted on exit. The normal action is
to clean up and delete these version files.

@item ediff-grab-mouse
@vindex @code{ediff-grab-mouse}
Default is @code{t}.  Normally, Ediff grabs mouse and puts it in its
control frame.  This is useful since the user can be sure that when he
needs to type an Ediff command the focus will be in an appropriate Ediff's
frame.  However, some users prefer to move the mouse by themselves.  The
above variable, if set to @code{maybe}, will prevent Ediff from grabbing
the mouse in many situations, usually after commands that may take more
time than usual.  In other situation, Ediff will continue grabbing the mouse
and putting it where it believes is appropriate.  If the value is
@code{nil}, then mouse is entirely user's responsibility.
Try different settings and see which one is for you.
@end table


@node Notes on Heavy-duty Customization, , Miscellaneous, Customization
@section Notes on Heavy-duty Customization

Some users need to customize Ediff in rather sophisticated ways, which
requires different defaults for different kinds of files (e.g., SGML,
etc.).  Ediff supports this kind of customization in several ways.  First,
most customization variables are buffer-local.  Those that aren't are
usually accessible from within Ediff Control Panel, so one can make them
local to the panel by calling make-local-variable from within
@code{ediff-startup-hook}.

Second, the function @code{ediff-setup} accepts an optional sixth
argument which has the form @code{((@var{var-name-1} .@: @var{val-1})
(@var{var-name-2} .@: @var{val-2}) @dots{})}.  The function
@code{ediff-setup} sets the variables in the list to the respective
values, locally in the Ediff control buffer.  This is an easy way to
throw in custom variables (which usually should be buffer-local) that
can then be tested in various hooks.

Make sure the variable @code{ediff-job-name} and @code{ediff-word-mode} are set
properly in this case, as some things in Ediff depend on this.

Finally, if you want custom-tailored help messages, you can set the
variables @code{ediff-brief-help-message-function} and
@code{ediff-long-help-message-function}
to functions that return help strings.
@vindex ediff-startup-hook
@findex ediff-setup
@vindex ediff-job-name
@vindex ediff-word-mode
@vindex ediff-brief-help-message-function
@vindex ediff-long-help-message-function

When customizing Ediff, some other variables are useful, although they are
not user-definable.  They are local to the Ediff control buffer, so this
buffer must be current when you access these variables.  The control buffer
is accessible via the variable @code{ediff-control-buffer}, which is also
local to that buffer.  It is usually used for checking if the current buffer
is also the control buffer.

Other variables of interest are:
@table @code
@item ediff-buffer-A
The first of the data buffers being compared.

@item ediff-buffer-B
The second of the data buffers being compared.

@item ediff-buffer-C
In three-way comparisons, this is the third buffer being compared.
In merging, this is the merge buffer.
In two-way comparison, this variable is @code{nil}.

@item ediff-window-A
The window displaying buffer A.  If buffer A is not visible, this variable
is @code{nil} or it may be a dead window.

@item ediff-window-B
The window displaying buffer B.

@item ediff-window-C
The window displaying buffer C, if any.

@item ediff-control-frame
A dedicated frame displaying the control buffer, if it exists.  It is
non-@code{nil} only if Ediff uses the multiframe display, i.e., when
the control buffer is in its own frame.
@end table

@node Credits, GNU Free Documentation License, Customization, Top
@chapter Credits

Ediff was written by Michael Kifer <kifer@@cs.stonybrook.edu>.  It was inspired
by emerge.el written by Dale R.@: Worley <drw@@math.mit.edu>.  An idea due to
Boris Goldowsky <boris@@cs.rochester.edu> made it possible to highlight
fine differences in Ediff buffers.  Alastair Burt <burt@@dfki.uni-kl.de>
ported Ediff to XEmacs, Eric Freudenthal <freudent@@jan.ultra.nyu.edu>
made it work with VC, Marc Paquette <marcpa@@cam.org> wrote the
toolbar support package for Ediff, and Hrvoje Niksic <hniksic@@xemacs.org>
adapted it to the Emacs customization package.

Many people provided help with bug reports, feature suggestions, and advice.
Without them, Ediff would not be nearly as useful as it is today.
Here is a hopefully full list of contributors:

@example
Adrian Aichner (aichner at ecf.teradyne.com),
Drew Adams (drew.adams at oracle.com),
Steve Baur (steve at xemacs.org),
Neal Becker (neal at ctd.comsat.com),
E.@: Jay Berkenbilt (ejb at ql.org),
Lennart Borgman (ennart.borgman at gmail.com)
Alastair Burt (burt at dfki.uni-kl.de),
Paul Bibilo (peb at delcam.co.uk),
Kevin Broadey (KevinB at bartley.demon.co.uk),
Harald Boegeholz (hwb at machnix.mathematik.uni-stuttgart.de),
Bradley A.@: Bosch (brad at lachman.com),
Michael D.@: Carney (carney at ltx-tr.com),
Jin S.@: Choi (jin at atype.com),
Scott Cummings (cummings at adc.com),
Albert Dvornik (bert at mit.edu),
Eric Eide (eeide at asylum.cs.utah.edu),
Paul Eggert (eggert at twinsun.com),
Urban Engberg (ue at cci.dk),
Kevin Esler (esler at ch.hp.com),
Robert Estes (estes at ece.ucdavis.edu),
Jay Finger (jayf at microsoft.com),
Xavier Fornari (xavier at europe.cma.fr),
Eric Freudenthal (freudent at jan.ultra.nyu.edu),
Job Ganzevoort (Job.Ganzevoort at cwi.nl),
Felix Heinrich Gatzemeier (felix.g at tzemeier.info),
Boris Goldowsky (boris at cs.rochester.edu),
Allan Gottlieb (gottlieb at allan.ultra.nyu.edu),
Aaron Gross (aaron at bfr.co.il),
Thorbjoern Hansen (thorbjoern.hansen at mchp.siemens.de),
Marcus Harnisch (marcus_harnisch at mint-tech.com),
Steven E. Harris (seh at panix.com),
Aaron S. Hawley (Aaron.Hawley at uvm.edu),
Xiaoli Huang (hxl at epic.com),
Andreas Jaeger (aj at suse.de),
Lars Magne Ingebrigtsen (larsi at ifi.uio.no),
Larry Gouge (larry at itginc.com),
Karl Heuer (kwzh at gnu.org),
(irvine at lks.csi.com),
(jaffe at chipmunk.cita.utoronto.ca),
David Karr (dkarr at nmo.gtegsc.com),
Norbert Kiesel (norbert at i3.informatik.rwth-aachen.de),
Steffen Kilb (skilb at gmx.net),
Leigh L Klotz (klotz at adoc.xerox.com),
Fritz Knabe (Fritz.Knabe at ecrc.de),
Heinz Knutzen (hk at informatik.uni-kiel.d400.de),
Andrew Koenig (ark at research.att.com),
Hannu Koivisto (azure at iki.fi),
Ken Laprade (laprade at dw3f.ess.harris.com),
Will C Lauer (wcl at cadre.com),
Richard Levitte (levitte at e.kth.se),
Mike Long (mike.long at analog.com),
Dave Love (d.love at dl.ac.uk),
Martin Maechler (maechler at stat.math.ethz.ch),
Simon Marshall (simon at gnu.org),
Paul C. Meuse (pmeuse at delcomsys.com),
Richard Mlynarik (mly at adoc.xerox.com),
Stefan Monnier (monnier at cs.yale.edu),
Chris Murphy (murphycm at sun.aston.ac.uk),
Erik Naggum (erik at naggum.no),
Eyvind Ness (Eyvind.Ness at hrp.no),
Ray Nickson (nickson at cs.uq.oz.au),
Dan Nicolaescu (dann at ics.uci.edu),
David Petchey (petchey_david at jpmorgan.com),
Benjamin Pierce (benjamin.pierce at cl.cam.ac.uk),
Francois Pinard (pinard at iro.umontreal.ca),
Tibor Polgar (tlp00 at spg.amdahl.com),
David Prince (dave0d at fegs.co.uk),
Paul Raines (raines at slac.stanford.edu),
Stefan Reicher (xsteve at riic.at),
Charles Rich (rich at merl.com),
Bill Richter (richter at math.nwu.edu),
C.S.@: Roberson (roberson at aur.alcatel.com),
Kevin Rodgers (kevin.rodgers at ihs.com),
Sandy Rutherford (sandy at ibm550.sissa.it),
Heribert Schuetz (schuetz at ecrc.de),
Andy Scott (ascott at pcocd2.intel.com),
Axel Seibert (axel at tumbolia.ppp.informatik.uni-muenchen.de),
Vin Shelton (acs at xemacs.org),
Scott O. Sherman (Scott.Sherman at mci.com),
Nikolaj Schumacher (n_schumacher at web.de),
Richard Stallman (rms at gnu.org),
Richard Stanton (stanton at haas.berkeley.edu),
Sam Steingold (sds at goems.com),
Ake Stenhoff (etxaksf at aom.ericsson.se),
Stig (stig at hackvan.com),
Peter Stout (Peter_Stout at cs.cmu.edu),
Chuck Thompson (cthomp at cs.uiuc.edu),
Ray Tomlinson (tomlinso at bbn.com),
Raymond Toy (toy at rtp.ericsson.se),
Stephen J. Turnbull  (stephen at xemacs.org),
Jan Vroonhof (vroonhof at math.ethz.ch),
Colin Walters (walters at cis.ohio-state.edu),
Philippe Waroquiers (philippe.waroquiers at eurocontrol.be),
Klaus Weber (gizmo at zork.north.de),
Ben Wing (ben at xemacs.org),
Tom Wurgler (twurgler at goodyear.com),
Steve Youngs (youngs at xemacs.org),
Ilya Zakharevich (ilya at math.ohio-state.edu),
Eli Zaretskii (eliz at is.elta.co.il)
@end example

@node GNU Free Documentation License, Index, Credits, Top
@appendix GNU Free Documentation License
@include doclicense.texi


@node Index, , GNU Free Documentation License, Top
@unnumbered Index
@printindex cp

@bye

@ignore
   arch-tag: 165ecb88-d03c-44b1-a921-b93f50b05b46
@end ignore