-(defun ediff-version ()
- "Return string describing the version of Ediff.
-When called interactively, displays the version."
- (interactive)
- (if (interactive-p)
- (message "Ediff version %s" (ediff-version))
- ediff-version))
-
-
-;; Hook variables
-
-(defvar ediff-before-setup-windows-hooks nil
- "*Hooks to run before Ediff sets its own window config.
-This can be used to save the previous window config, which can be restored
-on ediff-quit or ediff-suspend.")
-(defvar ediff-startup-hooks nil
- "*Hooks to run in the control buffer after Ediff has been set up.")
-(defvar ediff-select-hooks nil
- "*Hooks to run after a difference has been selected.")
-(defvar ediff-unselect-hooks nil
- "*Hooks to run after a difference has been unselected.")
-(defvar ediff-prepare-buffer-hooks nil
- "*Hooks called after buffers A and B are set up.")
-(defvar ediff-load-hooks nil
- "*Hook run after Ediff is loaded. Can be used to change defaults.")
-
-(defvar ediff-suspend-hooks (list 'ediff-default-suspend-hook)
- "*Hooks to run in the Ediff control buffer when Ediff is suspended.")
-(defvar ediff-quit-hooks (list 'ediff-default-quit-hook)
- "*Hooks to run in the Ediff control buffer after finishing Ediff.")
-
-(make-variable-buffer-local 'local-write-file-hooks)
-(make-variable-buffer-local 'before-change-function)
-
-;; Help messages
-
-(defconst ediff-help-message-long
- "p,DEL - prev diff v/V - scroll up/dn ab - diff A to B * - refine diff
-n,SPC - next diff </> - scroll lt/rt ba - diff B to A ! - recomp diffs
- j - jump to diff s - toggle split ra - restore A i - status info
-ga/gb - goto pt in A/B h - toggle hilit rb - restore B z - suspend Ediff
- c - recenter @ - toggle refine q - quit Ediff
- #f/#h - toggle focus/hide diff regions
-wa/wb - save buf A/B A/B - toggle read-only in buffers A/B ? - toggle help")
-
-(defconst ediff-help-message-short
- " ? - toggle help window")
-
-(defvar ediff-help-message ediff-help-message-long
- "*The actual help message.")
-
-;; diff stuff.
-(defvar ediff-diff-program "diff"
- "*Name of the program that compares two files.")
-(defvar ediff-diff-options ""
- "*Options to pass to `ediff-diff-program'.
-If diff\(1\) is used as `ediff-diff-program', then the most useful options are
-`-w', to ignore space, and `-i', to ignore case of letters.")
-
-;; Fine differences
-(defvar ediff-forward-word-function 'ediff-forward-word
- "*Function to call to move to the next word.
-Used for splitting difference regions into individual words.")
-
-(defvar ediff-fine-diff-program "diff"
- "*Name of the program that compares the current diff regions for fine differences.
-
-This program should produce output in the format of diff. One could
-possibly use `spiff' here if appropriate options are set.")
-
-(defvar ediff-fine-diff-options ""
- "*Options to pass to `ediff-fine-diff-program'.
-If diff\(1\) is used as `ediff-diff-program', then the most useful options are
-`-w', to ignore space, and `-i', to ignore case of letters.")
-
-(defvar ediff-whitespace " \n\t\C-j"
- "*White space. Used to split strings into words.")
-
-(defvar ediff-word-1 "a-zA-Z---_`'.?!:"
- "*Characters constituting type 1 words.
-
-Ediff is using a very simple schema for splitting text into words, which is
-used to determine fine differences between regions. There are two types of
-words. One consists entirely out of characters in `ediff-word-1' and
-another out of characters matching `ediff-word-1'.")
-
-(defvar ediff-word-2 "^a-zA-Z---_`'.?!: \t\n\C-j"
- "*Characters matching this regexp constitute words of type 2.
-See `ediff-word-1' for more details.")
-
-;; Selective browsing
-
-(defconst ediff-skip-diff-region-function 'ediff-show-all-diffs
- "Function that determines the next/previous diff region to show.")
-
-(defconst ediff-regexp-focus-A ""
- "Regexp that determines buf A regions to focus on when skipping to diff.")
-(defconst ediff-regexp-focus-B ""
- "Regexp that determines buf B regions to focus on when skipping to diff.")
-
-(defconst ediff-regexp-hide-A ""
- "Regexp that determines buf A regions to ignore when skipping to diff.")
-(defconst ediff-regexp-hide-B ""
- "Regexp that determines buf B regions to ignore when skipping to diff.")
-
-
-;; Support for patches
-
-(defvar ediff-patch-program "patch"
- "*Name of the program that applies patches.")
-(defvar ediff-patch-options ""
- "*Options to pass to ediff-patch-program.")
-
-(defvar ediff-shell (cond ((eq system-type 'emx) "cmd") ;; OS/2
- (t "sh")) ;; unix
- "*The shell used to run diff and patch. If user's .profile or
-.cshrc files are set up correctly, any shell will do. However, some people
-set $prompt or other things incorrectly, which leads to undesirable output
-messages. These may cause Ediff to fail. In such a case, set ediff-shell
-to a shell that you are not using or, better, fix your shell's startup file.")
-
-(defvar ediff-diff-ok-lines-regexp
- "^\\([0-9,]+[acd][0-9,]+$\\|[<>] \\|---\\|Warning:\\)"
- "*Regexp that matches normal output lines from `ediff-diff-program'.
-This is mostly lifted from Emerge, except that Ediff also considers the
-'Missing newline' message to be 'normal output.'
-Lines that do not match are assumed to be error messages.")
-
-(defvar ediff-fine-diff-ok-lines-regexp
- "^\\([0-9,]+[acd][0-9,]+$\\|[<>] \\|---\\|Warning:\\)"
- "*Regexp that matches normal output lines from `ediff-fine-diff-program'.
-This is mostly lifted from Emerge, except that Ediff also considers the
-'Missing newline' message to be 'normal output.'
-Lines that do not match are assumed to be error messages.")
-
-(defvar ediff-match-diff-line (let ((x "\\([0-9]+\\)\\(\\|,\\([0-9]+\\)\\)"))
- (concat "^" x "\\([acd]\\)" x "$"))
- "*Pattern to match lines produced by diff that describe differences.")
-
-(defvar ediff-patch-buf nil
- "The buffer of the patch file.")
-(defvar ediff-patch-diagnostics nil
- "The buffer where patch would display its diagnostics.")
-
-
-;; Copying diffs betw buffers.
-
-(ediff-defvar-local ediff-killed-diffs-alist nil
- "A list of killed diffs.
-A diff is saved here if it is replaced by a diff
-from another buffer. This alist has the form:
-\((num (A . diff) (B . diff)) ...),
-where A or B parts may be missing.")
-
-
-;; Highlighting
-(defvar ediff-before-flag-bol
- ;"vvvvvvvvvvvvvvvv---- ediff ----vvvvvvvvvvvvvvv\n"
- ">>--->>>\n"
- "*Flag placed above the highlighted block of differences.
-Must end with newline. Must be set before Ediff is loaded.")
-(defvar ediff-after-flag-bol
- ;"^^^^^^^^^^^^^^^^---- ediff ----^^^^^^^^^^^^^^^\n"
- "<<<---<<\n"
- "*Flag placed below the highlighted block of differences.
-Must end with newline. Must be set before Ediff is loaded.")
-
-(defvar ediff-before-flag-mol ">>--->>>"
- "*Like ediff-before-flag, used when a difference starts in mid-line.")
-(defvar ediff-after-flag-mol "<<<---<<"
- "*Like ediff-after-flag, used when a difference starts in mid-line.")
-
-(ediff-defvar-local ediff-before-flag-A nil
- "This is the actual ASCII before-flag in effect in buffer A.
-It is either `ediff-before-flag-mol' or `ediff-before-flag-bol' depending
-on whether the selected difference region starts in the middle of a line
-or at the beginning of a line.")
-(ediff-defvar-local ediff-after-flag-A nil
- "This is the actual ASCII after-flag in effect in buffer A.
-It is either `ediff-before-flag-mol' or `ediff-before-flag-bol' depending
-on whether the selected difference region starts in the middle of a line
-or at the beginning of a line.")
-(ediff-defvar-local ediff-before-flag-B nil
- "This is the actual ASCII before-flag in effect in buffer B.
-It is either `ediff-before-flag-mol' or `ediff-before-flag-bol' depending
-on whether the selected difference region starts in the middle of a line
-or at the beginning of a line.")
-(ediff-defvar-local ediff-after-flag-B nil
- "This is the actual ASCII after-flag in effect in buffer B.
-It is either `ediff-before-flag-mol' or `ediff-before-flag-bol' depending
-on whether the selected difference region starts in the middle of a line
-or at the beginning of a line.")
-
-
-(ediff-defvar-local ediff-want-faces t
- "If t, differences are highlighted using faces on a window system.
-If nil, they are highlighted using ASCII flags, ediff-before-flag
-and ediff-after-flag. On a non-window system, differences are always
-highlighted using ASCII flags.
-
-This variable can be set either in .emacs or toggled interactively, using
-ediff-toggle-hilit.")
-
-(ediff-defvar-local ediff-want-default-menus t
- "If t, Ediff will set up menus in the menu bar.
-This variable must be set before Ediff is loaded. If you don't like the
-look of the default menus, set this variable to nil and make your own
-menus.")
-
-(ediff-defvar-local ediff-auto-refine 'on
- "If `'on', Ediff auto-highlights fine diffs for the current diff region.
-If `off', auto-highlighting is not used. If `'nix', no fine diffs are shown
-at all, unless the user force-refines the region by hitting `*'.
-
-This variable can be set either in .emacs or toggled interactively, using
-ediff-toggle-hilit.")
-
-(ediff-defvar-local ediff-auto-refine-limit 700
- "Auto-refine only those regions that are smaller than this number of bytes.")
-
-(ediff-defvar-local ediff-highlight-all-diffs t
- "If nil, only the selected differences are highlighted.
-This variable can be set either in .emacs or toggled interactively, using
-ediff-toggle-hilit.")
-
-(ediff-defvar-local ediff-highlighting-style nil
- "A var local to each control panel buffer.
-Indicates highlighting style in effect for this buffer: `face', `ascii',
-nil -- temporarily unhighlighted, `off' -- turned off \(on a dumb
-terminal only\).")
-
-
-
-;; Variables that control each Ediff session. They are local to the
-;; control buffer.
-
-;; Mode variables
-(ediff-defvar-local ediff-A-buffer nil
- "The buffer in which the A variant is stored.")
-(ediff-defvar-local ediff-B-buffer nil
- "The buffer in which the B variant is stored.")
-(ediff-defvar-local ediff-control-buffer nil
- "The control buffer of ediff. ")
-
-;(ediff-defvar-local ediff-control-buffer-suffix nil
-; "The suffix of the control buffer name. ")
-
-(ediff-defvar-local ediff-control-window nil
- "The control window.")
-(ediff-defvar-local ediff-window-config-saved ""
- "Ediff's window configuration.
-Used to minimize the need to rearrange windows.")
-
-
-(ediff-defvar-local ediff-A-buffer-values nil
- "Keeps working values of ediff-saved-variables for ediff-A-buffer.")
-(ediff-defvar-local ediff-B-buffer-values nil
- "Keeps working values of ediff-saved-variables for ediff-B-buffer.")
-
-(ediff-defvar-local ediff-A-buffer-values-setup nil
- "Remembers ediff-saved-variables for ediff-A-buffer as they were at setup.")
-(ediff-defvar-local ediff-B-buffer-values-setup nil
- "Remembers ediff-saved-variables for ediff-B-buffer as they were at setup.")
-
-(ediff-defvar-local ediff-difference-vector nil
- "Vector of differences between the variants.
-Each difference is represented by a vector of two overlays. The first
-overlays the difference section in the A buffer and the second overlays the
-diff in the B buffer. If a difference section is empty, the corresponding
-overlay's endpoints coincide. ")
-
-(ediff-defvar-local ediff-current-difference -1
- "The difference that is currently selected.")
-(ediff-defvar-local ediff-number-of-differences nil
- "Number of differences found.")
-
-(ediff-defvar-local ediff-diff-buffer nil
- "Buffer containing the output of diff, which is used by Ediff to step
-through files.")
-(ediff-defvar-local ediff-tmp-buffer nil
- "Temporary buffer used for computing fine differences.")
-(ediff-defvar-local ediff-error-buffer nil
- "Buffer containing the output of diff when diff returns errors.")
-
-(ediff-defvar-local ediff-this-buffer-control-sessions nil
- "List of ediff control panels associated with each buffer A/B.")
-
-(defvar ediff-disturbed-overlays nil
- "List of difference overlays disturbed by working with the current diff.")
-
-(defvar ediff-shaded-overlay-priority 100
- "Priority of non-selected overlays.")
-
-
-(if (ediff-if-lucid)
- (progn
- (fset 'ediff-overlayp (symbol-function 'extentp))
- (fset 'ediff-make-overlay (symbol-function 'make-extent))
- (fset 'ediff-delete-overlay (symbol-function 'delete-extent))
- (fset 'ediff-overlay-put (symbol-function 'set-extent-property))
- (fset 'ediff-move-overlay (symbol-function 'set-extent-endpoints))
- (fset 'ediff-overlay-start (symbol-function 'extent-start-position))
- (fset 'ediff-overlay-end (symbol-function 'extent-end-position))
- (fset 'ediff-overlay-get (symbol-function 'extent-property)))
- (fset 'ediff-overlayp (symbol-function 'overlayp))
- (fset 'ediff-make-overlay (symbol-function 'make-overlay))
- (fset 'ediff-delete-overlay (symbol-function 'delete-overlay))
- (fset 'ediff-overlay-put (symbol-function 'overlay-put))
- (fset 'ediff-move-overlay (symbol-function 'move-overlay))
- (fset 'ediff-overlay-start (symbol-function 'overlay-start))
- (fset 'ediff-overlay-end (symbol-function 'overlay-end))
- (fset 'ediff-overlay-get (symbol-function 'overlay-get)))
-
-(if window-system
- (if (ediff-if-lucid)
- (progn
- (fset 'ediff-select-frame (symbol-function 'select-screen))
- (fset 'ediff-window-frame (symbol-function 'window-screen))
- (fset 'ediff-display-color-p (symbol-function 'x-color-display-p))
- (fset 'ediff-valid-color-p (symbol-function 'x-valid-color-name-p))
- (fset 'ediff-get-face (symbol-function 'get-face)))
- (fset 'ediff-window-frame (symbol-function 'window-frame))
- (fset 'ediff-select-frame (symbol-function 'select-frame))
- (fset 'ediff-display-color-p (symbol-function 'x-display-color-p))
-
- ;; This is a temporary fix for OS/2 users
- ;; pm-win.el in PM-Emacs should be fixed.
- (if (eq window-system 'pm)
- (fset 'ediff-valid-color-p
- (function (lambda (color) (assoc color pm-color-alist))))
- (fset 'ediff-valid-color-p (symbol-function 'x-color-defined-p))
- )
-
- (fset 'ediff-get-face (symbol-function 'internal-get-face)))
- ;; not a window system
- (fset 'ediff-window-frame (function (lambda (wind) (if wind 1 nil)) ))
- (fset 'ediff-select-frame (symbol-function 'identity))
- (fset 'ediff-make-current-diff-overlay (function (lambda (type) nil)))
- (fset 'ediff-unhighlight-diffs-totally (function (lambda () nil))))
-
-
-(if (not window-system)
- ()
- (defun ediff-set-face (ground face color)
- "Sets face foreground/background."
- (if (ediff-valid-color-p color)
- (if (eq ground 'foreground)
- (set-face-foreground face color)
- (set-face-background face color))
- (cond ((memq face
- '(ediff-current-diff-face-A ediff-current-diff-face-B))
- (copy-face 'highlight face))
- ((memq face
- '(ediff-fine-diff-face-A ediff-fine-diff-face-B))
- (copy-face 'secondary-selection face)
- (set-face-underline-p face t))
- ((memq face
- '(ediff-odd-diff-face-A ediff-odd-diff-face-B
- ediff-even-diff-face-A ediff-even-diff-face-B))
- (copy-face 'secondary-selection face)))))
-
- (defvar ediff-current-diff-face-A
- (progn
- (make-face 'ediff-current-diff-face-A)
- (or (face-differs-from-default-p 'ediff-current-diff-face-A)
- (cond ((ediff-display-color-p)
- (ediff-set-face
- 'foreground 'ediff-current-diff-face-A "firebrick")
- (ediff-set-face
- 'background 'ediff-current-diff-face-A "pale green"))
- (t
- (if (ediff-if-lucid)
- (copy-face 'modeline 'ediff-current-diff-face-A)
- (copy-face 'highlight 'ediff-current-diff-face-A))
- )))
- 'ediff-current-diff-face-A)
- ;;(ediff-get-face 'ediff-current-diff-face-A))
- "Face for highlighting the selected difference in buffer A.")
-
- (defvar ediff-current-diff-face-B
- (progn
- (make-face 'ediff-current-diff-face-B)
- (or (face-differs-from-default-p 'ediff-current-diff-face-B)
- (cond ((ediff-display-color-p)
- (ediff-set-face
- 'foreground 'ediff-current-diff-face-B "DarkOrchid")
- (ediff-set-face
- 'background 'ediff-current-diff-face-B "Yellow"))
- (t
- (if (ediff-if-lucid)
- (copy-face 'modeline 'ediff-current-diff-face-B)
- (copy-face 'highlight 'ediff-current-diff-face-B))
- )))
- 'ediff-current-diff-face-B)
- ;;(ediff-get-face 'ediff-current-diff-face-B))
- "Face for highlighting the selected difference in buffer B.")
-
- (defvar ediff-fine-diff-face-A
- (progn
- (make-face 'ediff-fine-diff-face-A)
- (or (face-differs-from-default-p 'ediff-fine-diff-face-A)
- (cond ((ediff-display-color-p)
- (ediff-set-face 'foreground 'ediff-fine-diff-face-A
- "Navy")
- (ediff-set-face 'background 'ediff-fine-diff-face-A
- "sky blue"))
- (t (set-face-underline-p 'ediff-fine-diff-face-A t))))
- 'ediff-fine-diff-face-A)
- ;;(ediff-get-face 'ediff-fine-diff-face-A))
- "Face for highlighting the refinement of the selected diff in buffer A.")
-
- (defvar ediff-fine-diff-face-B
- (progn
- (make-face 'ediff-fine-diff-face-B)
- (or (face-differs-from-default-p 'ediff-fine-diff-face-B)
- (cond ((ediff-display-color-p)
- (ediff-set-face 'foreground 'ediff-fine-diff-face-B "Black")
- (ediff-set-face 'background 'ediff-fine-diff-face-B "cyan"))
- (t (set-face-underline-p 'ediff-fine-diff-face-B t))))
- 'ediff-fine-diff-face-B)
- ;;(ediff-get-face 'ediff-fine-diff-face-B))
- "Face for highlighting the refinement of the selected diff in buffer B.")
-
-
- (defvar ediff-even-diff-face-A
- (progn
- (make-face 'ediff-even-diff-face-A)
- (or (face-differs-from-default-p 'ediff-even-diff-face-A)
- (cond ((ediff-display-color-p)
- (ediff-set-face
- 'foreground 'ediff-even-diff-face-A "black")
- (ediff-set-face
- 'background 'ediff-even-diff-face-A "light grey"))
- (t
- (copy-face 'italic 'ediff-even-diff-face-A))))
- 'ediff-even-diff-face-A)
- ;;(ediff-get-face 'ediff-even-diff-face-A))
- "Face used to highlight even-numbered differences in buffer A.")
-
- (defvar ediff-even-diff-face-B
- (progn
- (make-face 'ediff-even-diff-face-B)
- (or (face-differs-from-default-p 'ediff-even-diff-face-B)
- (cond ((ediff-display-color-p)
- (ediff-set-face
- 'foreground 'ediff-even-diff-face-B "White")
- (ediff-set-face
- 'background 'ediff-even-diff-face-B "Gray"))
- (t
- (copy-face 'italic 'ediff-even-diff-face-B))))
- 'ediff-even-diff-face-B)
- ;;(ediff-get-face 'ediff-even-diff-face-B))
- "Face used to highlight even-numbered differences in buffer B.")
-
- (defvar ediff-odd-diff-face-A
- (progn
- (make-face 'ediff-odd-diff-face-A)
- (or (face-differs-from-default-p 'ediff-odd-diff-face-A)
- (cond ((ediff-display-color-p)
- (ediff-set-face
- 'foreground 'ediff-odd-diff-face-A "White")
- (ediff-set-face
- 'background 'ediff-odd-diff-face-A "Gray"))
- (t
- (copy-face 'italic 'ediff-odd-diff-face-A))))
- 'ediff-odd-diff-face-A)
- ;;(ediff-get-face 'ediff-odd-diff-face-A))
- "Face used to highlight odd-numbered differences in buffer A.")
-
- (defvar ediff-odd-diff-face-B
- (progn
- (make-face 'ediff-odd-diff-face-B)
- (or (face-differs-from-default-p 'ediff-odd-diff-face-B)
- (cond ((ediff-display-color-p)
- (ediff-set-face
- 'foreground 'ediff-odd-diff-face-B "Black")
- (ediff-set-face
- 'background 'ediff-odd-diff-face-B "light grey"))
- (t
- (copy-face 'italic 'ediff-odd-diff-face-B))))
- 'ediff-odd-diff-face-B)
- ;;(ediff-get-face 'ediff-odd-diff-face-B))
- "Face used to highlight odd-numbered differences in buffer B.")
-
- ;; Create *-var faces. These are the actual faces used to highlight
- ;; odd-numbered difference regions.
- ;; They are used as follows: when highlighting is turned on,
- ;; ediff-odd/even-diff-face-A/B are copied
- ;; into ediff-odd/even-diff-face-A/B-var, and all odd/even overlays become
- ;; highlighted. When highlighting is turned off, then the face 'default is
- ;; copied into ediff-odd/even-diff-face-A/B-var, thereby unhighlighting all
- ;; difference regions.
- (make-face 'ediff-even-diff-face-A-var)
- (make-face 'ediff-even-diff-face-B-var)
- (make-face 'ediff-odd-diff-face-A-var)
- (make-face 'ediff-odd-diff-face-B-var)
-
- ;; initialize *-var faces
- (defun ediff-init-var-faces ()
- (copy-face (if (and ediff-want-faces ediff-highlight-all-diffs)
- ediff-even-diff-face-A 'default)
- 'ediff-even-diff-face-A-var)
- (copy-face (if (and ediff-want-faces ediff-highlight-all-diffs)
- ediff-even-diff-face-B 'default)
- 'ediff-even-diff-face-B-var)
- (copy-face (if (and ediff-want-faces ediff-highlight-all-diffs)
- ediff-odd-diff-face-A 'default)
- 'ediff-odd-diff-face-A-var)
- (copy-face (if (and ediff-want-faces ediff-highlight-all-diffs)
- ediff-odd-diff-face-B 'default)
- 'ediff-odd-diff-face-B-var))
-
-
- ;;; Overlays
-
- (ediff-defvar-local ediff-current-diff-overlay-A nil
- "Overlay in buffer A.")
- (ediff-defvar-local ediff-current-diff-overlay-B nil
- "Overlay in buffer B.")
-
- (defun ediff-make-current-diff-overlay (type)
- (let ((overlay (if (eq type 'A)
- 'ediff-current-diff-overlay-A
- 'ediff-current-diff-overlay-B))
- (buffer (ediff-get-buffer type))
- (face (if (eq type 'A)
- (face-name ediff-current-diff-face-A)
- (face-name ediff-current-diff-face-B))))
- (set overlay (ediff-make-overlay (point-max) (point-max) buffer))
- (ediff-overlay-put (eval overlay) 'face face)
- (ediff-overlay-put (eval overlay) 'ediff ediff-control-buffer)
- ))
-
- ;; Compute priority of ediff overlay.
- (defun ediff-highest-priority (start end buffer)
- (let ((pos (max 1 (1- start)))
- ovr-list)
- (if (ediff-if-lucid)
- (1+ ediff-shaded-overlay-priority)
- (ediff-eval-in-buffer
- buffer
- (while (< pos (min (point-max) (1+ end)))
- (setq ovr-list (append (overlays-at pos) ovr-list))
- (setq pos (next-overlay-change pos)))
- (1+ (eval
- (cons '+
- (mapcar (function
- (lambda (ovr)
- (if ovr
- (or (ediff-overlay-get ovr 'priority) 0)
- 0)))
- ovr-list)
- )))
- ))))
-
-) ; end of window-system-only code.
-
-
-
-;;; Misc
-
-(defvar ediff-split-window-function 'split-window-vertically
- "*The function to split the main window between buffer-A and buffer-B.
-You can set it to be split horizontally instead of the
-default vertical split by setting this variable to
-'split-window-horizontally. You can also have your own function for fancy
-splits. This variable has no effect when buffer-A and buffer-B are shown in
-different frames. In this case, Ediff will use those frames to display
-these buffers.")
-
-(defconst ediff-saved-variables
- '(buffer-read-only
- buffer-auto-save-file-name)
- "Buffer-local variables saved and restored during an Ediff session.")
-
-(defconst ediff-working-values '(nil nil)
- "Values to be assigned to `ediff-saved-variables' during diff.")
-
-(defvar ediff-use-last-dir nil
- "*If t, Ediff uses previous directory as default when reading file name.")
-
-(defvar ediff-no-help-in-control-buffer nil
- "*Non-nil means C-h should not invoke Emacs help in control buffer.
-Instead, C-h jumps to previous difference.")
-
-(defvar ediff-temp-file-prefix
- (let ((env (or (getenv "TMPDIR")
- (getenv "TMP")
- (getenv "TEMP")))
- d)
- (setq d (if (and env (> (length env) 0))
- env
- "/tmp"))
- (if (= (aref d (1- (length d))) ?/)
- (setq d (substring d 0 -1)))
- (concat d "/ediff"))
- "*Prefix to put on Ediff temporary file names.
-Do not start with `~/' or `~user-name/'.")
-
-(defvar ediff-temp-file-mode 384 ; u=rw only
- "*Mode for Ediff temporary files.")
-
-(ediff-defvar-local ediff-temp-file-A nil
- "Temporary file used for refining difference regions in buffer B.")
-(ediff-defvar-local ediff-temp-file-B nil
- "Temporary file used for refining difference regions in buffer B.")
-
-(defvar ediff-last-dir-A nil
- "Last directory used by an Ediff command for file-A.")
-(defvar ediff-last-dir-B nil
- "Last directory used by an Ediff command for file-B.")
-(defvar ediff-last-dir-patch nil
- "Last directory used by an Ediff command for file to patch.")
-
-;; Build keymaps
-
-(defvar ediff-mode-map nil
- "Local keymap used in Ediff mode.")
-
-(defun ediff-frame-has-menubar ()
- (if (ediff-if-lucid)
- current-menubar
- (< 0 (cdr (assq 'menu-bar-lines (frame-parameters (selected-frame)))))