]> code.delx.au - gnu-emacs/blobdiff - lisp/ediff-init.el
(desktop-save): Save list of minor modes.
[gnu-emacs] / lisp / ediff-init.el
index 77e8f1c9ad6b7592f394692a24e1bb6aae9d2297..08490c4c16ceb885b735f33cf2b917a663744da3 100644 (file)
@@ -32,6 +32,7 @@
 (defvar ediff-mouse-pixel-threshold)
 (defvar ediff-whitespace)
 (defvar ediff-multiframe)
+(defvar ediff-use-toolbar-p)
 
 (and noninteractive
      (eval-when-compile
@@ -59,15 +60,22 @@ that Ediff doesn't know about.")
   (and (ediff-device-type) (not (memq (ediff-device-type) '(tty pc stream)))))
 
 ;; test if supports faces
-;; ediff-force-faces is for those devices that support faces, but we don't know
-;; this yet
 (defun ediff-has-face-support-p ()
   (cond ((ediff-window-display-p))
        (ediff-force-faces)
        (ediff-emacs-p (memq (ediff-device-type) '(pc)))
        (ediff-xemacs-p (memq (ediff-device-type) '(tty pc)))))
 
-  
+(defun ediff-has-toolbar-support-p ()
+  (and ediff-xemacs-p
+       (featurep 'toolbar)
+       (console-on-window-system-p)))
+
+(defun ediff-use-toolbar-p ()
+  (and (ediff-has-toolbar-support-p)   ;Can it do it ?
+       (boundp 'ediff-use-toolbar-p)
+       ediff-use-toolbar-p))           ;Does the user want it ?
+
 ;; Defines SYMBOL as an advertised local variable.  
 ;; Performs a defvar, then executes `make-variable-buffer-local' on
 ;; the variable.  Also sets the `permanent-local' property,
@@ -76,10 +84,10 @@ that Ediff doesn't know about.")
 ;; 
 ;; Plagiarised from `emerge-defvar-local' for XEmacs.
 (defmacro ediff-defvar-local (var value doc) 
-  (` (progn
-       (defvar (, var) (, value) (, doc))
-       (make-variable-buffer-local '(, var))
-       (put '(, var) 'permanent-local t))))
+  `(progn
+     (defvar ,var ,value ,doc)
+     (make-variable-buffer-local ',var)
+     (put ',var 'permanent-local t)))
     
 
 
@@ -90,7 +98,7 @@ that Ediff doesn't know about.")
 (ediff-defvar-local ediff-buffer-A nil "")
 ;; The buffer in which the B variant is stored.
 (ediff-defvar-local ediff-buffer-B nil "")
-;; The buffer in which the C variant is stored.
+;; The buffer in which the C variant is stored or where the merge buffer lives.
 (ediff-defvar-local ediff-buffer-C nil "")
 ;; Ancestor buffer
 (ediff-defvar-local ediff-ancestor-buffer nil "")
@@ -106,36 +114,35 @@ that Ediff doesn't know about.")
 
 ;;; Macros
 (defmacro ediff-odd-p (arg)
-  (` (eq (logand (, arg) 1) 1)))
+  `(eq (logand ,arg 1) 1))
 
 (defmacro ediff-buffer-live-p (buf)
-  (` (and (, buf) (get-buffer (, buf)) (buffer-name (get-buffer (, buf))))))
+  `(and ,buf (get-buffer ,buf) (buffer-name (get-buffer ,buf))))
 
 (defmacro ediff-get-buffer (arg)
-  (` (cond ((eq (, arg) 'A) ediff-buffer-A)
-          ((eq (, arg) 'B) ediff-buffer-B)
-          ((eq (, arg) 'C) ediff-buffer-C)
-          ((eq (, arg) 'Ancestor) ediff-ancestor-buffer)
-          )
-  ))
+  `(cond ((eq ,arg 'A) ediff-buffer-A)
+        ((eq ,arg 'B) ediff-buffer-B)
+        ((eq ,arg 'C) ediff-buffer-C)
+        ((eq ,arg 'Ancestor) ediff-ancestor-buffer)
+        ))
   
 (defmacro ediff-get-value-according-to-buffer-type (buf-type list)
-  (` (cond ((eq (, buf-type) 'A) (nth 0 (, list)))
-          ((eq (, buf-type) 'B) (nth 1 (, list)))
-          ((eq (, buf-type) 'C) (nth 2 (, list))))))
+  `(cond ((eq ,buf-type 'A) (nth 0 ,list))
+        ((eq ,buf-type 'B) (nth 1 ,list))
+        ((eq ,buf-type 'C) (nth 2 ,list))
+        ))
           
 (defmacro ediff-char-to-buftype (arg)
-  (` (cond ((memq (, arg) '(?a ?A)) 'A)
-          ((memq (, arg) '(?b ?B)) 'B)
-          ((memq (, arg) '(?c ?C)) 'C)
-          )
-  ))
+  `(cond ((memq ,arg '(?a ?A)) 'A)
+        ((memq ,arg '(?b ?B)) 'B)
+        ((memq ,arg '(?c ?C)) 'C)
+        ))
 
 
 ;; A-list is supposed to be of the form (A . symb) (B . symb)...)
 ;; where the first part of any association is a buffer type and the second is
-;; an appropriate symbol. Given buffer-type, this function returns the
-;; symbol. This is used to avoid using `intern'
+;; an appropriate symbol.  Given buffer-type, this function returns the
+;; symbol.  This is used to avoid using `intern'
 (defsubst ediff-get-symbol-from-alist (buf-type alist)
   (cdr (assoc buf-type alist)))
   
@@ -146,16 +153,16 @@ that Ediff doesn't know about.")
     (Ancestor . ediff-difference-vector-Ancestor)))
 
 (defmacro ediff-get-difference (n buf-type)
-  (` (aref
-      (symbol-value
-       (ediff-get-symbol-from-alist
-       (, buf-type) ediff-difference-vector-alist))
-      (, n))))
+  `(aref
+    (symbol-value
+     (ediff-get-symbol-from-alist
+      ,buf-type ediff-difference-vector-alist))
+    ,n))
   
 ;; Tell if it has been previously determined that the region has
 ;; no diffs other than the white space and newlines
 ;; The argument, N, is the diff region number used by Ediff to index the
-;; diff vector. It is 1 less than the number seen by the user.
+;; diff vector.  It is 1 less than the number seen by the user.
 ;; Returns:
 ;;             t  if the diffs are whitespace in all buffers
 ;;             'A (in 3-buf comparison only) if there are only whitespace
@@ -165,122 +172,127 @@ that Ediff doesn't know about.")
 ;;             'C (in 3-buf comparison only) if there are only whitespace
 ;;                diffs in bufs A and B
 ;;
-;; A difference vector has the form:
+;; A Difference Vector has the form:
 ;; [diff diff diff ...]
 ;; where each diff has the form:
-;; [overlay fine-diff-vector no-fine-diffs-flag]
+;; [overlay fine-diff-vector no-fine-diffs-flag state-of-difference]
 ;; fine-diff-vector is a vector [fine-diff fine-diff fine-diff ...]
+;; no-fine-diffs-flag says if there are fine differences.
+;; state-of-difference is A, B, C, or nil, indicating which buffer is
+;;     different from the other two (used only in 3-way jobs).
 (defmacro ediff-no-fine-diffs-p (n)
-  (` (aref (ediff-get-difference (, n) 'A) 2)))
+  `(aref (ediff-get-difference ,n 'A) 2))
   
 (defmacro ediff-get-diff-overlay-from-diff-record (diff-rec)
-  (` (aref (, diff-rec) 0)))
+  `(aref ,diff-rec 0))
   
 (defmacro ediff-get-diff-overlay (n buf-type)  
-  (` (ediff-get-diff-overlay-from-diff-record
-      (ediff-get-difference (, n) (, buf-type)))))
+  `(ediff-get-diff-overlay-from-diff-record
+    (ediff-get-difference ,n ,buf-type)))
 
 (defmacro ediff-get-fine-diff-vector-from-diff-record (diff-rec)
-  (` (aref (, diff-rec) 1)))
+  `(aref ,diff-rec 1))
       
 (defmacro ediff-set-fine-diff-vector (n buf-type fine-vec)
-  (` (aset (ediff-get-difference (, n) (, buf-type)) 1 (, fine-vec))))
+  `(aset (ediff-get-difference ,n ,buf-type) 1 ,fine-vec))
   
 (defmacro ediff-get-state-of-diff (n buf-type)
-  (` (if (ediff-buffer-live-p ediff-buffer-C)
-        (aref (ediff-get-difference (, n) (, buf-type)) 3))))
+  `(if (ediff-buffer-live-p ediff-buffer-C)
+       (aref (ediff-get-difference ,n ,buf-type) 3)))
 (defmacro ediff-set-state-of-diff (n buf-type val)
-  (` (aset (ediff-get-difference (, n) (, buf-type)) 3 (, val))))
+  `(aset (ediff-get-difference ,n ,buf-type) 3 ,val))
+
 (defmacro ediff-get-state-of-merge (n)
-  (` (if ediff-state-of-merge
-        (aref (aref ediff-state-of-merge (, n)) 0))))
-(defmacro ediff-get-state-of-ancestor (n)
-  (` (if ediff-state-of-merge
-        (aref (aref ediff-state-of-merge (, n)) 1))))
+  `(if ediff-state-of-merge
+       (aref (aref ediff-state-of-merge ,n) 0)))
 (defmacro ediff-set-state-of-merge (n val)
-  (` (if ediff-state-of-merge
-        (aset (aref ediff-state-of-merge (, n)) 0 (, val)))))
+  `(if ediff-state-of-merge
+       (aset (aref ediff-state-of-merge ,n) 0 ,val)))
+
+(defmacro ediff-get-state-of-ancestor (n)
+  `(if ediff-state-of-merge
+       (aref (aref ediff-state-of-merge ,n) 1)))
 
 ;; if flag is t, puts a mark on diff region saying that 
-;; the differences are in white space only. If flag is nil,
+;; the differences are in white space only.  If flag is nil,
 ;; the region is marked as essential (i.e., differences are
 ;; not just in the white space and newlines.)
 (defmacro ediff-mark-diff-as-space-only (n flag)
-  (` (aset (ediff-get-difference (, n) 'A) 2 (, flag))))
+  `(aset (ediff-get-difference ,n 'A) 2 ,flag))
   
 (defmacro ediff-get-fine-diff-vector (n buf-type)
-  (` (ediff-get-fine-diff-vector-from-diff-record
-      (ediff-get-difference (, n) (, buf-type)))))
+  `(ediff-get-fine-diff-vector-from-diff-record
+    (ediff-get-difference ,n ,buf-type)))
   
 ;; Macro to switch to BUFFER, evaluate BODY, returns to original buffer.
 ;; Doesn't save the point and mark.
 ;; This is `with-current-buffer' with the added test for live buffers."
 (defmacro ediff-with-current-buffer (buffer &rest body)
-  (` (if (ediff-buffer-live-p (, buffer))
+  `(if (ediff-buffer-live-p ,buffer)
        (save-current-buffer
-        (set-buffer (, buffer))
-        (,@ body))
+        (set-buffer ,buffer)
+        ,@body)
      (or (eq this-command 'ediff-quit)
         (error ediff-KILLED-VITAL-BUFFER))
-     )))
+     ))
      
 
 (defsubst ediff-multiframe-setup-p ()
   (and (ediff-window-display-p) ediff-multiframe))
                         
 (defmacro ediff-narrow-control-frame-p ()
-  (` (and (ediff-multiframe-setup-p)
-         (equal ediff-help-message ediff-brief-message-string))))
+  `(and (ediff-multiframe-setup-p)
+       (equal ediff-help-message ediff-brief-message-string)))
          
 (defmacro ediff-3way-comparison-job ()
-  (` (memq
-      ediff-job-name
-      '(ediff-files3 ediff-buffers3))))
+  `(memq
+    ediff-job-name
+    '(ediff-files3 ediff-buffers3)))
 (ediff-defvar-local ediff-3way-comparison-job nil "")
       
 (defmacro ediff-merge-job ()
-  (` (memq
-      ediff-job-name
-      '(ediff-merge-files
-       ediff-merge-buffers
-       ediff-merge-files-with-ancestor
-       ediff-merge-buffers-with-ancestor
-       ediff-merge-revisions
-       ediff-merge-revisions-with-ancestor))))
+  `(memq
+    ediff-job-name
+    '(ediff-merge-files
+      ediff-merge-buffers
+      ediff-merge-files-with-ancestor
+      ediff-merge-buffers-with-ancestor
+      ediff-merge-revisions
+      ediff-merge-revisions-with-ancestor)))
 (ediff-defvar-local ediff-merge-job nil "")
 
 (defmacro ediff-merge-with-ancestor-job ()
-  (` (memq
-      ediff-job-name
-      '(ediff-merge-files-with-ancestor
-       ediff-merge-buffers-with-ancestor
-       ediff-merge-revisions-with-ancestor))))
+  `(memq
+    ediff-job-name
+    '(ediff-merge-files-with-ancestor
+      ediff-merge-buffers-with-ancestor
+      ediff-merge-revisions-with-ancestor)))
 (ediff-defvar-local ediff-merge-with-ancestor-job nil "")
 
 (defmacro ediff-3way-job ()
-  (` (or ediff-3way-comparison-job ediff-merge-job)))
+  `(or ediff-3way-comparison-job ediff-merge-job))
 (ediff-defvar-local ediff-3way-job nil "")
 
 ;; A diff3 job is like a 3way job, but ediff-merge doesn't require the use
 ;; of diff3.
 (defmacro ediff-diff3-job ()
-  (` (or ediff-3way-comparison-job
-        ediff-merge-with-ancestor-job)))
+  `(or ediff-3way-comparison-job
+       ediff-merge-with-ancestor-job))
 (ediff-defvar-local ediff-diff3-job nil "")
         
 (defmacro ediff-windows-job ()
-  (` (memq ediff-job-name '(ediff-windows-wordwise ediff-windows-linewise))))
+  `(memq ediff-job-name '(ediff-windows-wordwise ediff-windows-linewise)))
 (ediff-defvar-local ediff-windows-job nil "")
 
 (defmacro ediff-word-mode-job ()
-  (` (memq ediff-job-name '(ediff-windows-wordwise  ediff-regions-wordwise))))
+  `(memq ediff-job-name '(ediff-windows-wordwise ediff-regions-wordwise)))
 (ediff-defvar-local ediff-word-mode-job nil "")
 
 (defmacro ediff-narrow-job ()
-  (` (memq ediff-job-name '(ediff-windows-wordwise
-                           ediff-regions-wordwise
-                           ediff-windows-linewise
-                           ediff-regions-linewise))))
+  `(memq ediff-job-name '(ediff-windows-wordwise
+                         ediff-regions-wordwise
+                         ediff-windows-linewise
+                         ediff-regions-linewise)))
 (ediff-defvar-local ediff-narrow-job nil "")
 
 ;; Note: ediff-merge-directory-revisions-with-ancestor is not treated as an
@@ -408,7 +420,7 @@ Can be used to move the frame where it is desired."
   
 (defcustom ediff-mode-hook nil
   "*Hook run just after ediff-mode is set up in the control buffer. 
-This is done before any windows or frames are created. One can use it to
+This is done before any windows or frames are created.  One can use it to
 set local variables that determine how the display looks like."
   :type 'hook
   :group 'ediff-hook)
@@ -431,9 +443,7 @@ set local variables that determine how the display looks like."
   :type 'hook
   :group 'ediff-hook) 
 (defcustom ediff-cleanup-hook nil
-  "*Hooks to run on exiting Ediff but before killing the control buffer.
-This is a place to do various cleanups, such as deleting the variant buffers.
-Ediff provides a function, `ediff-janitor', as one such possible hook."
+  "*Hooks to run on exiting Ediff but before killing the control and variant buffers."
   :type 'hook
   :group 'ediff-hook)
 
@@ -444,7 +454,7 @@ Ediff provides a function, `ediff-janitor', as one such possible hook."
   "Sorry, comparison of identical variants is not what I am made for...")
 (defconst ediff-BAD-DIFF-NUMBER
   ;; %S stands for this-command, %d - diff number, %d - max diff
-  "%S: Bad diff region number, %d. Valid numbers are 1 to %d")
+  "%S: Bad diff region number, %d.  Valid numbers are 1 to %d")
 (defconst ediff-BAD-INFO (format "
 *** The Info file for Ediff, a part of the standard distribution
 *** of %sEmacs, does not seem to be properly installed.
@@ -457,8 +467,8 @@ Ediff provides a function, `ediff-janitor', as one such possible hook."
 (ediff-defvar-local ediff-skip-diff-region-function 'ediff-show-all-diffs
   "Function that determines the next/previous diff region to show.
 Should return t for regions to be ignored and nil otherwise.
-This function gets a region number as an argument. The region number
-is the one used internally by Ediff. It is 1 less than the number seen
+This function gets a region number as an argument.  The region number
+is the one used internally by Ediff.  It is 1 less than the number seen
 by the user.")
 
 (ediff-defvar-local ediff-hide-regexp-matches-function
@@ -526,13 +536,14 @@ See the documentation string of `ediff-focus-on-regexp-matches' for details.")
   :group 'ediff)
 
   
-(ediff-defvar-local ediff-use-faces t 
+(ediff-defvar-local ediff-use-faces t "") 
+(defcustom ediff-use-faces t 
   "If t, differences are highlighted using faces, if device supports faces.
 If nil, differences 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.
-Use `setq-default' if setting it in .emacs")
+highlighted using ASCII flags."
+  :type 'boolean
+  :group 'ediff-highlighting)
 
 ;; this indicates that diff regions are word-size, so fine diffs are
 ;; permanently nixed; used in ediff-windows-wordwise and ediff-regions-wordwise
@@ -551,7 +562,7 @@ Use `setq-default' if setting it in .emacs")
 (ediff-defvar-local ediff-wide-bounds nil "")
 
 ;; Current visibility boundaries in buffers A, B, and C.
-;; This is also a list of overlays. When the user toggles narrow/widen,
+;; This is also a list of overlays.  When the user toggles narrow/widen,
 ;; this list changes from ediff-wide-bounds to ediff-narrow-bounds.
 ;; and back.
 (ediff-defvar-local ediff-visible-bounds nil "")
@@ -569,10 +580,13 @@ meaning of this variable."
   :type 'boolean
   :group 'ediff)
 
-(ediff-defvar-local ediff-highlight-all-diffs t
+(ediff-defvar-local ediff-highlight-all-diffs t "")
+(defcustom 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. Use `setq-default' to set it.") 
+Otherwise, all difference regions are highlighted, but the selected region is
+shown in brighter colors."
+  :type 'boolean
+  :group 'ediff-highlighting)
 
 ;; A var local to each control panel buffer.  Indicates highlighting style
 ;; in effect for this buffer: `face', `ascii', nil -- temporarily
@@ -612,17 +626,17 @@ ediff-toggle-hilit. Use `setq-default' to set it.")
 ;; represented by a vector of two overlays plus a vector of fine diffs,
 ;; plus a no-fine-diffs flag.  The first overlay spans the
 ;; difference region in the A buffer and the second overlays the diff in
-;; the B buffer. If a difference section is empty, the corresponding
+;; the B buffer.  If a difference section is empty, the corresponding
 ;; overlay's endpoints coincide.
 ;;
-;; The precise form of a difference vector for one buffer is:
+;; The precise form of a Difference Vector for one buffer is:
 ;; [diff diff diff ...]
 ;; where each diff has the form:
-;; [diff-overlay fine-diff-vector no-fine-diffs-flag state-of-difference]
+;; [diff-overlay fine-diff-vector no-fine-diffs-flag state-of-diff]
 ;; fine-diff-vector is a vector [fine-diff-overlay fine-diff-overlay ...]
 ;; no-fine-diffs-flag says if there are fine differences.
 ;; state-of-difference is A, B, C, or nil, indicating which buffer is
-;; different from the other two (used only in 3-way jobs.
+;;     different from the other two (used only in 3-way jobs.
 (ediff-defvar-local ediff-difference-vector-A nil "")
 (ediff-defvar-local ediff-difference-vector-B nil "")
 (ediff-defvar-local ediff-difference-vector-C nil "")
@@ -636,7 +650,7 @@ ediff-toggle-hilit. Use `setq-default' to set it.")
 
 ;; [ status status status ...]
 ;; Each status: [state-of-merge state-of-ancestor]
-;; state-of-merge is default-A, default-B, prefer-A, or prefer-B. It
+;; state-of-merge is default-A, default-B, prefer-A, or prefer-B.  It
 ;; indicates the way a diff region was created in buffer C.
 ;; state-of-ancestor says if the corresponding region in ancestor buffer is
 ;; empty.
@@ -650,7 +664,7 @@ ediff-toggle-hilit. Use `setq-default' to set it.")
 ;; Buffer containing the output of diff, which is used by Ediff to step
 ;; through files.
 (ediff-defvar-local ediff-diff-buffer nil "")
-;; Like ediff-diff-buffer, but contains context diff. It is not used by
+;; Like ediff-diff-buffer, but contains context diff.  It is not used by
 ;; Ediff, but it is saved in a file, if user requests so.
 (ediff-defvar-local ediff-custom-diff-buffer nil "")
 ;; Buffer used for diff-style fine differences between regions.
@@ -677,9 +691,9 @@ ediff-toggle-hilit. Use `setq-default' to set it.")
 
 (defcustom ediff-version-control-package 'vc
   "Version control package used.
-Currently, Ediff supports vc.el, rcs.el, pcl-cvs.el, and generic-sc.el. The
-standard Emacs interface to RCS, CVS, SCCS, etc., is vc.el. However, some
-people find the other two packages more convenient. Set this variable to the
+Currently, Ediff supports vc.el, rcs.el, pcl-cvs.el, and generic-sc.el.  The
+standard Emacs interface to RCS, CVS, SCCS, etc., is vc.el.  However, some
+people find the other two packages more convenient.  Set this variable to the
 appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
   :type 'symbol
   :group 'ediff)
@@ -703,7 +717,7 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
 ;; emacs-minor-version are defined.  Otherwise, for Emacs/XEmacs 19, if the
 ;; current minor version is < 10 (xemacs) or < 23 (emacs) the return value
 ;; will be nil (when op is =, >, or >=) and t (when op is <, <=), which may be
-;; incorrect. However, this gives correct result in our cases, since we are
+;; incorrect.  However, this gives correct result in our cases, since we are
 ;; testing for sufficiently high Emacs versions.
 (defun ediff-check-version (op major minor &optional type-of-emacs)
   (if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version))
@@ -751,7 +765,7 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
       ;; pm-win.el in PM-Emacs should be fixed.
       (if (eq (ediff-device-type) 'pm)
          (fset 'ediff-valid-color-p 
-               (function (lambda (color) (assoc color pm-color-alist))))
+               (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))))
 
@@ -819,35 +833,6 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
          (t ""))   ; none
     ))
 
-;;(defun ediff-set-face (ground face color)
-;;  "Set face foreground/background."
-;;  (if (ediff-has-face-support-p)
-;;      (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
-;;                    ediff-current-diff-face-C
-;;                    ediff-current-diff-face-Ancestor))
-;;            (copy-face 'highlight face))
-;;           ((memq face
-;;                  '(ediff-fine-diff-face-A
-;;                    ediff-fine-diff-face-B
-;;                    ediff-fine-diff-face-C
-;;                    ediff-fine-diff-face-Ancestor))
-;;            (copy-face 'secondary-selection face)
-;;            (set-face-underline-p face t))
-;;           ((memq face
-;;                  '(ediff-even-diff-face-A
-;;                    ediff-odd-diff-face-A 
-;;                    ediff-even-diff-face-B ediff-odd-diff-face-B
-;;                    ediff-even-diff-face-C ediff-odd-diff-face-C
-;;                    ediff-even-diff-face-Ancestor
-;;                    ediff-odd-diff-face-Ancestor))
-;;            (copy-face 'secondary-selection face))))
-;;    ))
 
 (defun ediff-set-face-pixmap (face pixmap)
   "Set face pixmap on a monochrome display."
@@ -863,34 +848,17 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
       (add-to-list 'facemenu-unlisted-faces face)))
       
 
-;;(defvar ediff-current-diff-face-A
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-current-diff-face-A)
-;;     (or (face-differs-from-default-p 'ediff-current-diff-face-A)
-;;         (cond ((ediff-color-display-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-xemacs-p
-;;                    (copy-face 'modeline 'ediff-current-diff-face-A)
-;;                  (copy-face 'highlight 'ediff-current-diff-face-A))
-;;                )))
-;;     'ediff-current-diff-face-A))
-;;  "Face for highlighting the selected difference in buffer A.")
 
 (defface ediff-current-diff-face-A
   '((((class color)) (:foreground "firebrick" :background "pale green"))
     (t (:inverse-video t)))
   "Face for highlighting the selected difference in buffer A."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-current-diff-face-A 'ediff-current-diff-face-A
   "Face for highlighting the selected difference in buffer A.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-current-diff-face-A'
 this variable represents.")
 (ediff-hide-face 'ediff-current-diff-face-A)
@@ -903,34 +871,16 @@ this variable represents.")
 
 
 
-;;(defvar ediff-current-diff-face-B
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-current-diff-face-B)
-;;     (or (face-differs-from-default-p 'ediff-current-diff-face-B)
-;;         (cond ((ediff-color-display-p)
-;;                (ediff-set-face
-;;                 'foreground 'ediff-current-diff-face-B "DarkOrchid")
-;;                (ediff-set-face
-;;                 'background 'ediff-current-diff-face-B "Yellow"))
-;;               (t 
-;;                (if ediff-xemacs-p
-;;                    (copy-face 'modeline 'ediff-current-diff-face-B)
-;;                  (copy-face 'highlight 'ediff-current-diff-face-B))
-;;                )))
-;;     'ediff-current-diff-face-B))
-;;  "Face for highlighting the selected difference in buffer B.")
-    
 (defface ediff-current-diff-face-B
   '((((class color)) (:foreground "DarkOrchid" :background "Yellow"))
     (t (:inverse-video t)))
   "Face for highlighting the selected difference in buffer B."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-current-diff-face-B 'ediff-current-diff-face-B
   "Face for highlighting the selected difference in buffer B.
- this variable. Instead, use the customization
+ this variable.  Instead, use the customization
 widget to customize the actual face `ediff-current-diff-face-B'
 this variable represents.")
 (ediff-hide-face 'ediff-current-diff-face-B)
@@ -941,34 +891,17 @@ this variable represents.")
         (not (ediff-color-display-p))) 
     (copy-face 'modeline 'ediff-current-diff-face-B))
 
-;;(defvar ediff-current-diff-face-C
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-current-diff-face-C)
-;;     (or (face-differs-from-default-p 'ediff-current-diff-face-C)
-;;         (cond ((ediff-color-display-p)
-;;                (ediff-set-face
-;;                 'foreground 'ediff-current-diff-face-C "Navy")
-;;                (ediff-set-face
-;;                 'background 'ediff-current-diff-face-C "Pink"))
-;;               (t 
-;;                (if ediff-xemacs-p
-;;                    (copy-face 'modeline 'ediff-current-diff-face-C)
-;;                  (copy-face 'highlight 'ediff-current-diff-face-C))
-;;                )))
-;;     'ediff-current-diff-face-C))
-;;  "Face for highlighting the selected difference in buffer C.")
 
 (defface ediff-current-diff-face-C
   '((((class color)) (:foreground "Navy" :background "Pink"))
     (t (:inverse-video t)))
   "Face for highlighting the selected difference in buffer C."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-current-diff-face-C 'ediff-current-diff-face-C
   "Face for highlighting the selected difference in buffer C.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-current-diff-face-C'
 this variable represents.")
 (ediff-hide-face 'ediff-current-diff-face-C)
@@ -979,26 +912,17 @@ this variable represents.")
         (not (ediff-color-display-p))) 
     (copy-face 'modeline 'ediff-current-diff-face-C))
 
-;;(defvar ediff-current-diff-face-Ancestor
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-current-diff-face-Ancestor)
-;;     (or (face-differs-from-default-p 'ediff-current-diff-face-Ancestor)
-;;         (copy-face 
-;;          'ediff-current-diff-face-C 'ediff-current-diff-face-Ancestor))
-;;     'ediff-current-diff-face-Ancestor))
-;;  "Face for highlighting the selected difference in the ancestor buffer.")
 
 (defface ediff-current-diff-face-Ancestor
   '((((class color)) (:foreground "Black" :background "VioletRed"))
     (t (:inverse-video t)))
   "Face for highlighting the selected difference in buffer Ancestor."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-current-diff-face-Ancestor 'ediff-current-diff-face-Ancestor
   "Face for highlighting the selected difference in buffer Ancestor.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-current-diff-face-Ancestor'
 this variable represents.")
 (ediff-hide-face 'ediff-current-diff-face-Ancestor)
@@ -1009,140 +933,48 @@ this variable represents.")
         (not (ediff-color-display-p))) 
     (copy-face 'modeline 'ediff-current-diff-face-Ancestor))
 
-;;(defvar ediff-fine-diff-pixmap "gray3"
-;;  "Pixmap to use for highlighting fine differences.")
-;;(defvar ediff-odd-diff-pixmap "gray1"
-;;  "Pixmap to use for highlighting odd differences.")
-;;(defvar ediff-even-diff-pixmap "Stipple"
-;;  "Pixmap to use for highlighting even differences.")
-
-;;(defvar ediff-fine-diff-face-A
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-fine-diff-face-A)
-;;     (or (face-differs-from-default-p 'ediff-fine-diff-face-A)
-;;         (cond ((ediff-color-display-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-set-face-pixmap 'ediff-fine-diff-face-A
-;;                                       ediff-fine-diff-pixmap)
-;;                )))
-;;     'ediff-fine-diff-face-A))
-;;  "Face for highlighting the refinement of the selected diff in buffer A.")
-
 
 (defface ediff-fine-diff-face-A
   '((((class color)) (:foreground "Navy" :background "sky blue"))
     (t (:underline t :stipple "gray3")))
   "Face for highlighting the refinement of the selected diff in buffer A."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-fine-diff-face-A 'ediff-fine-diff-face-A
   "Face for highlighting the fine differences in buffer A.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-fine-diff-face-A'
 this variable represents.")
 (ediff-hide-face 'ediff-fine-diff-face-A)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap 'ediff-fine-diff-face-A "gray3"))
-
-;;(defvar ediff-fine-diff-face-B
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-fine-diff-face-B)
-;;     (or (face-differs-from-default-p 'ediff-fine-diff-face-B)
-;;         (cond ((ediff-color-display-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-set-face-pixmap 'ediff-fine-diff-face-B
-;;                                       ediff-fine-diff-pixmap)
-;;                )))
-;;     'ediff-fine-diff-face-B))
-;;  "Face for highlighting the refinement of the selected diff in buffer B.")
 
 (defface ediff-fine-diff-face-B
   '((((class color)) (:foreground "Black" :background "cyan"))
     (t (:underline t :stipple "gray3")))
   "Face for highlighting the refinement of the selected diff in buffer B."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-fine-diff-face-B 'ediff-fine-diff-face-B
   "Face for highlighting the fine differences in buffer B.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-fine-diff-face-B'
 this variable represents.")
 (ediff-hide-face 'ediff-fine-diff-face-B)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap 'ediff-fine-diff-face-B "gray3"))
-    
-;;(defvar ediff-fine-diff-face-C
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-fine-diff-face-C)
-;;     (or (face-differs-from-default-p 'ediff-fine-diff-face-C)
-;;         (cond ((ediff-color-display-p)
-;;                (ediff-set-face 'foreground 'ediff-fine-diff-face-C "black")
-;;                (ediff-set-face
-;;                 'background 'ediff-fine-diff-face-C "Turquoise"))
-;;               (t
-;;                (set-face-underline-p 'ediff-fine-diff-face-C t)
-;;                (ediff-set-face-pixmap 'ediff-fine-diff-face-C
-;;                                       ediff-fine-diff-pixmap)
-;;                )))
-;;     'ediff-fine-diff-face-C))
-;;  "Face for highlighting the refinement of the selected diff in buffer C.")
 
 (defface ediff-fine-diff-face-C
   '((((class color)) (:foreground "Black" :background "Turquoise"))
     (t (:underline t :stipple "gray3")))
   "Face for highlighting the refinement of the selected diff in buffer C."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-fine-diff-face-C 'ediff-fine-diff-face-C
   "Face for highlighting the fine differences in buffer C.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-fine-diff-face-C'
 this variable represents.")
 (ediff-hide-face 'ediff-fine-diff-face-C)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap 'ediff-fine-diff-face-C "gray3"))
-
-;;(defvar ediff-fine-diff-face-Ancestor
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-fine-diff-face-Ancestor)
-;;     (ediff-hide-face 'ediff-fine-diff-face-Ancestor)
-;;     (or (face-differs-from-default-p 'ediff-fine-diff-face-Ancestor)
-;;         (progn
-;;           (copy-face
-;;            'ediff-fine-diff-face-C 'ediff-fine-diff-face-Ancestor)
-;;           (ediff-set-face-pixmap 'ediff-fine-diff-face-Ancestor
-;;                                  ediff-fine-diff-pixmap))
-;;         )))
-;;  "Face highlighting refinements of the selected diff in ancestor buffer.
-;;Presently, this is not used, as difference regions are not refined in the
-;;ancestor buffer.")
 
 (defface ediff-fine-diff-face-Ancestor
   '((((class color)) (:foreground "Black" :background "Green"))
@@ -1151,165 +983,79 @@ this variable represents.")
 At present, this face is not used and no fine differences are computed for the
 ancestor buffer."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-fine-diff-face-Ancestor 'ediff-fine-diff-face-Ancestor
   "Face for highlighting the fine differences in buffer Ancestor.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-fine-diff-face-Ancestor'
 this variable represents.")
 (ediff-hide-face 'ediff-fine-diff-face-Ancestor)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap
-     'ediff-fine-diff-face-Ancestor "gray3"))
-    
-;;(defvar ediff-even-diff-face-A
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-even-diff-face-A)
-;;     (or (face-differs-from-default-p 'ediff-even-diff-face-A)
-;;         (cond ((ediff-color-display-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-set-face-pixmap 'ediff-even-diff-face-A
-;;                                       ediff-even-diff-pixmap)
-;;                )))
-;;     'ediff-even-diff-face-A))
-;;  "Face used for highlighting even-numbered differences in buffer A.")
+
+;; Some installs don't have stipple or Stipple. So, try them in turn.
+(defvar stipple-pixmap
+  (cond ((not (ediff-has-face-support-p)) nil)
+       ((and (boundp 'x-bitmap-file-path)
+             (locate-library "stipple" t x-bitmap-file-path)) "stipple")
+       ((and (boundp 'mswindowsx-bitmap-file-path)
+             (locate-library "stipple" t mswindowsx-bitmap-file-path)) "stipple")
+       (t "Stipple")))
 
 (defface ediff-even-diff-face-A
-  '((((class color)) (:foreground "Black" :background "light grey"))
-    (t (:italic t :stipple "Stipple")))
+  `((((class color)) (:foreground "Black" :background "light grey"))
+    (t (:italic t :stipple ,stipple-pixmap)))
   "Face for highlighting even-numbered non-current differences in buffer A."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-even-diff-face-A 'ediff-even-diff-face-A
   "Face for highlighting even-numbered non-current differences in buffer A.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-even-diff-face-A'
 this variable represents.")
 (ediff-hide-face 'ediff-even-diff-face-A)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap 'ediff-even-diff-face-A "Stipple"))
-      
-;;(defvar ediff-even-diff-face-B
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-even-diff-face-B)
-;;     (or (face-differs-from-default-p 'ediff-even-diff-face-B)
-;;         (cond ((ediff-color-display-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-set-face-pixmap 'ediff-even-diff-face-B
-;;                                       ediff-even-diff-pixmap)
-;;                )))
-;;     'ediff-even-diff-face-B))
-;;  "Face used for highlighting even-numbered differences in buffer B.")
 
 (defface ediff-even-diff-face-B
-  '((((class color)) (:foreground "White" :background "Grey"))
-    (t (:italic t :stipple "Stipple")))
+  `((((class color)) (:foreground "White" :background "Grey"))
+    (t (:italic t :stipple ,stipple-pixmap)))
   "Face for highlighting even-numbered non-current differences in buffer B."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-even-diff-face-B 'ediff-even-diff-face-B
   "Face for highlighting even-numbered non-current differences in buffer B.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-even-diff-face-B'
 this variable represents.")
 (ediff-hide-face 'ediff-even-diff-face-B)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap 'ediff-even-diff-face-B "Stipple"))
-    
-;;(defvar ediff-even-diff-face-C
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-even-diff-face-C)
-;;     (ediff-hide-face 'ediff-even-diff-face-C)
-;;     (or (face-differs-from-default-p 'ediff-even-diff-face-C)
-;;         (progn
-;;           (copy-face 'ediff-even-diff-face-A 'ediff-even-diff-face-C)
-;;           (ediff-set-face-pixmap 'ediff-even-diff-face-C
-;;                                  ediff-even-diff-pixmap)))
-;;     'ediff-even-diff-face-C))
-;;  "Face used for highlighting even-numbered differences in buffer C.")
 
 (defface ediff-even-diff-face-C
-  '((((class color)) (:foreground "Black" :background "light grey"))
-    (t (:italic t :stipple "Stipple")))
+  `((((class color)) (:foreground "Black" :background "light grey"))
+    (t (:italic t :stipple ,stipple-pixmap)))
   "Face for highlighting even-numbered non-current differences in buffer C."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-even-diff-face-C 'ediff-even-diff-face-C
   "Face for highlighting even-numbered non-current differences in buffer C.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-even-diff-face-C'
 this variable represents.")
 (ediff-hide-face 'ediff-even-diff-face-C)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap 'ediff-even-diff-face-C "Stipple"))
-
-;;(defvar ediff-even-diff-face-Ancestor
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-even-diff-face-Ancestor)
-;;     (ediff-hide-face 'ediff-even-diff-face-Ancestor)
-;;     (or (face-differs-from-default-p 'ediff-even-diff-face-Ancestor)
-;;         (progn
-;;           (copy-face
-;;            'ediff-even-diff-face-C 'ediff-even-diff-face-Ancestor)
-;;           (ediff-set-face-pixmap 'ediff-even-diff-face-Ancestor
-;;                                  ediff-even-diff-pixmap)))
-;;     'ediff-even-diff-face-Ancestor))
-;;  "Face highlighting even-numbered differences in the ancestor buffer.")
 
 (defface ediff-even-diff-face-Ancestor
-  '((((class color)) (:foreground "White" :background "Grey"))
-    (t (:italic t :stipple "Stipple")))
+  `((((class color)) (:foreground "White" :background "Grey"))
+    (t (:italic t :stipple ,stipple-pixmap)))
   "Face for highlighting even-numbered non-current differences in the ancestor buffer."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-even-diff-face-Ancestor 'ediff-even-diff-face-Ancestor
   "Face for highlighting even-numbered non-current differences in buffer Ancestor.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-even-diff-face-Ancestor'
 this variable represents.")
 (ediff-hide-face 'ediff-even-diff-face-Ancestor)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap
-     'ediff-even-diff-face-Ancestor "Stipple"))
 
 ;; Association between buffer types and even-diff-face symbols
 (defconst ediff-even-diff-face-alist
@@ -1318,146 +1064,62 @@ this variable represents.")
     (C . ediff-even-diff-face-C)
     (Ancestor . ediff-even-diff-face-Ancestor)))
 
-;;(defvar ediff-odd-diff-face-A
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-odd-diff-face-A)
-;;     (or (face-differs-from-default-p 'ediff-odd-diff-face-A)
-;;         (cond ((ediff-color-display-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-set-face-pixmap 'ediff-odd-diff-face-A
-;;                                       ediff-odd-diff-pixmap)
-;;                )))
-;;     'ediff-odd-diff-face-A))
-;;  "Face used for highlighting odd-numbered differences in buffer A.")
-
 (defface ediff-odd-diff-face-A
   '((((class color)) (:foreground "White" :background "Grey"))
     (t (:italic t :stipple "gray1")))
   "Face for highlighting odd-numbered non-current differences in buffer A."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-odd-diff-face-A 'ediff-odd-diff-face-A
   "Face for highlighting odd-numbered non-current differences in buffer A.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-odd-diff-face-A'
 this variable represents.")
 (ediff-hide-face 'ediff-odd-diff-face-A)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap 'ediff-odd-diff-face-A "gray1"))
-      
-;;(defvar ediff-odd-diff-face-B
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-odd-diff-face-B)
-;;     (ediff-hide-face 'ediff-odd-diff-face-B)
-;;     (or (face-differs-from-default-p 'ediff-odd-diff-face-B)
-;;         (cond ((ediff-color-display-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-set-face-pixmap 'ediff-odd-diff-face-B
-;;                                       ediff-odd-diff-pixmap)
-;;                )))
-;;     'ediff-odd-diff-face-B))
-;;  "Face used for highlighting odd-numbered differences in buffer B.")
+
 
 (defface ediff-odd-diff-face-B
   '((((class color)) (:foreground "Black" :background "light grey"))
     (t (:italic t :stipple "gray1")))
   "Face for highlighting odd-numbered non-current differences in buffer B."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-odd-diff-face-B 'ediff-odd-diff-face-B
   "Face for highlighting odd-numbered non-current differences in buffer B.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-odd-diff-face-B'
 this variable represents.")
 (ediff-hide-face 'ediff-odd-diff-face-B)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap 'ediff-odd-diff-face-B "gray1"))
-    
-;;(defvar ediff-odd-diff-face-C
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-odd-diff-face-C)
-;;     (or (face-differs-from-default-p 'ediff-odd-diff-face-C)
-;;         (progn
-;;           (copy-face 'ediff-odd-diff-face-A 'ediff-odd-diff-face-C)
-;;           (ediff-set-face-pixmap 'ediff-odd-diff-face-C
-;;                                  ediff-odd-diff-pixmap)))
-;;     'ediff-odd-diff-face-C))
-;;  "Face used for highlighting odd-numbered differences in buffer C.")
 
 (defface ediff-odd-diff-face-C
   '((((class color)) (:foreground "White" :background "Grey"))
     (t (:italic t :stipple "gray1")))
   "Face for highlighting odd-numbered non-current differences in buffer C."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-odd-diff-face-C 'ediff-odd-diff-face-C
   "Face for highlighting odd-numbered non-current differences in buffer C.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-odd-diff-face-C'
 this variable represents.")
 (ediff-hide-face 'ediff-odd-diff-face-C)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap 'ediff-odd-diff-face-C "gray1"))
-
-;;(defvar ediff-odd-diff-face-Ancestor 
-;;  (if (ediff-has-face-support-p)
-;;      (progn
-;;     (make-face 'ediff-odd-diff-face-Ancestor)
-;;     (or (face-differs-from-default-p 'ediff-odd-diff-face-Ancestor)
-;;         (progn
-;;           (copy-face 'ediff-odd-diff-face-C 'ediff-odd-diff-face-Ancestor)
-;;           (ediff-set-face-pixmap 'ediff-odd-diff-face-Ancestor
-;;                                  ediff-odd-diff-pixmap)))
-;;     'ediff-odd-diff-face-Ancestor))
-;;  "Face used for highlighting even-numbered differences in the ancestor buffer.")
 
 (defface ediff-odd-diff-face-Ancestor
   '((((class color)) (:foreground "Black" :background "light grey"))
     (t (:italic t :stipple "gray1")))
   "Face for highlighting odd-numbered non-current differences in the ancestor buffer."
   :group 'ediff-highlighting)
-;; An internal variable. Ediff takes the face from here. When unhighlighting,
+;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-odd-diff-face-Ancestor 'ediff-odd-diff-face-Ancestor
   "Face for highlighting odd-numbered non-current differences in buffer Ancestor.
-DO NOT CHANGE this variable. Instead, use the customization
+DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-odd-diff-face-Ancestor'
 this variable represents.")
 (ediff-hide-face 'ediff-odd-diff-face-Ancestor)
-;; Until custom.el for XEmacs starts supporting :stipple we do this.
-;; This means that some use customization may be trashed.
-(if (and ediff-xemacs-p
-        (ediff-has-face-support-p)
-        (not (ediff-color-display-p))) 
-    (ediff-set-face-pixmap 'ediff-odd-diff-face-Ancestor "gray1"))
 
 ;; Association between buffer types and odd-diff-face symbols
 (defconst ediff-odd-diff-face-alist
@@ -1506,11 +1168,10 @@ this variable represents.")
          (setq ovr-list (append (overlays-at pos) ovr-list))
          (setq pos (next-overlay-change pos)))
        (1+ (apply '+
-                  (mapcar (function
-                           (lambda (ovr)
-                             (if ovr
-                                 (or (ediff-overlay-get ovr 'priority) 0)
-                               0)))
+                  (mapcar (lambda (ovr)
+                            (if ovr
+                                (or (ediff-overlay-get ovr 'priority) 0)
+                              0))
                           ovr-list)
                   ))
        ))))
@@ -1536,14 +1197,14 @@ This property can be toggled interactively."
 
 (defcustom ediff-autostore-merges  'group-jobs-only
   "*Save the results of merge jobs automatically.
-Nil means don't save automatically. t means always save. Anything but nil or t
+Nil means don't save automatically.  t means always save.  Anything but nil or t
 means save automatically only if the merge job is part of a group of jobs, such
 as `ediff-merge-directory' or `ediff-merge-directory-revisions'."
   :type '(choice (const nil) (const t) (const group-jobs-only))
   :group 'ediff-merge)
 (make-variable-buffer-local 'ediff-autostore-merges)
 
-;; file where the result of the merge is to be saved. used internally
+;; file where the result of the merge is to be saved.  used internally
 (ediff-defvar-local ediff-merge-store-file nil "")
   
 (defcustom ediff-no-emacs-help-in-control-buffer nil
@@ -1552,22 +1213,22 @@ Instead, C-h would jump to previous difference."
   :type 'boolean
   :group 'ediff)
   
-(defcustom ediff-temp-file-prefix
-  (let ((env (or (getenv "TMPDIR")
-                (getenv "TMP")
-                (getenv "TEMP")))
-       d)
-    (setq d (if (and env (> (length env) 0))
-               env
-             (cond ((memq system-type '(vax-vms axp-vms)) "SYS$SCRATCH:")
-                   ((eq system-type 'ms-dos) "c:/")
-                   (t "/tmp"))))
-    ;; The following is to make sure we get something to which we can
-    ;; add directory levels under VMS.
-    (setq d (file-name-as-directory (directory-file-name d)))
-    )
+;; This is the same as temporary-file-directory from Emacs 20.3.
+;; Copied over here because XEmacs doesn't have this variable.
+(defcustom ediff-temp-file-prefix 
+  (file-name-as-directory 
+   (cond ((boundp 'temporary-file-directory) temporary-file-directory)
+        ((fboundp 'temp-directory) (temp-directory))
+        (t "/tmp/")))
+;;;  (file-name-as-directory 
+;;;   (cond ((memq system-type '(ms-dos windows-nt))
+;;;      (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP") "c:/temp"))
+;;;     ((memq system-type '(vax-vms axp-vms))
+;;;      (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "SYS$SCRATCH:"))
+;;;     (t
+;;;      (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp"))))
   "*Prefix to put on Ediff temporary file names.
-Do not start with `~/' or `~user-name/'."
+Do not start with `~/' or `~USERNAME/'."
   :type 'string
   :group 'ediff)
 
@@ -1638,17 +1299,16 @@ This default should work without changes."
         (eval (ediff-get-symbol-from-alist
                buf-type ediff-difference-vector-alist)))
        overl diff-num)
-    (mapcar (function
-            (lambda (rec)
-              (setq overl (ediff-get-diff-overlay-from-diff-record rec)
-                    diff-num (ediff-overlay-get overl 'ediff-diff-num))
-              (if (ediff-overlay-buffer overl)
-                  ;; only if overlay is alive
-                  (ediff-set-overlay-face
-                   overl
-                   (if (not unhighlight)
-                       (ediff-background-face buf-type diff-num))))
-              ))
+    (mapcar (lambda (rec)
+             (setq overl (ediff-get-diff-overlay-from-diff-record rec)
+                   diff-num (ediff-overlay-get overl 'ediff-diff-num))
+             (if (ediff-overlay-buffer overl)
+                 ;; only if overlay is alive
+                 (ediff-set-overlay-face
+                  overl
+                  (if (not unhighlight)
+                      (ediff-background-face buf-type diff-num))))
+             )
            diff-vector)))
 
 
@@ -1837,7 +1497,7 @@ This default should work without changes."
            ;; Don't grab on quit, if the user doesn't want to.
            ;; If ediff-grab-mouse = t, then mouse won't be grabbed for
            ;; sessions that are not part of a group (this is done in
-           ;; ediff-recenter). The condition below affects only terminating
+           ;; ediff-recenter).  The condition below affects only terminating
            ;; sessions in session groups (in which case mouse is warped into
            ;; a meta buffer).
            (and (eq ediff-grab-mouse 'maybe)
@@ -1849,7 +1509,7 @@ This default should work without changes."
   (setq ediff-mouse-pixel-position (mouse-pixel-position)))
 
 ;; It is not easy to find out when the user grabs the mouse, since emacs and
-;; xemacs behave differently when mouse is not in any frame. Also, this is
+;; xemacs behave differently when mouse is not in any frame.  Also, this is
 ;; sensitive to when the user grabbed mouse.  Not used for now.
 (defun ediff-user-grabbed-mouse ()
   (if ediff-mouse-pixel-position
@@ -1889,15 +1549,15 @@ This default should work without changes."
 (defsubst ediff-empty-overlay-p (overl)
   (= (ediff-overlay-start overl) (ediff-overlay-end overl)))
 
-;; like overlay-buffer in Emacs. In XEmacs, returns nil if the extent is
-;; dead. Otherwise, works like extent-buffer
+;; like overlay-buffer in Emacs.  In XEmacs, returns nil if the extent is
+;; dead.  Otherwise, works like extent-buffer
 (defun ediff-overlay-buffer (overl)
   (if ediff-emacs-p
       (overlay-buffer overl)
     (and (extent-live-p overl) (extent-object overl))))
 
-;; like overlay-get in Emacs. In XEmacs, returns nil if the extent is
-;; dead. Otherwise, like extent-property
+;; like overlay-get in Emacs.  In XEmacs, returns nil if the extent is
+;; dead.  Otherwise, like extent-property
 (defun ediff-overlay-get (overl property)
   (if ediff-emacs-p
       (overlay-get overl property)
@@ -1964,7 +1624,7 @@ Checks if overlay's buffer exists."
         (abbreviate-file-name file t))))
 
 ;; Takes a directory and returns the parent directory.
-;; does nothing to `/'. If the ARG is a regular file,
+;; does nothing to `/'.  If the ARG is a regular file,
 ;; strip the file AND the last dir.
 (defun ediff-strip-last-dir (dir)
   (if (not (stringp dir)) (setq dir default-directory))
@@ -1986,6 +1646,9 @@ Checks if overlay's buffer exists."
       (setq substr (substring str (max 0 (- len 1 newlen))))
       (concat "..." substr))))
 
+(defsubst ediff-nonempty-string-p (string)
+  (and (stringp string) (not (string= string ""))))
+
 (defun ediff-abbrev-jobname (jobname)
   (cond ((eq jobname 'ediff-directories)
         "Compare two directories")