]> code.delx.au - gnu-emacs/blobdiff - lisp/ediff-init.el
(switch_to_buffer_1): New subroutine, taken out from Fswitch_to_buffer.
[gnu-emacs] / lisp / ediff-init.el
index 9ca1400a8cdb19823a11d711b3422bb6dcb87c29..fc91c7bbea2948d8003e73c2d129286c78f109bb 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,
@@ -346,6 +354,21 @@ that Ediff doesn't know about.")
       (error "%S: This command runs in Ediff Control Buffer only!"
             this-command)))
 
+(defgroup ediff-highlighting nil
+  "Hilighting of difference regions in Ediff"
+  :prefix "ediff-"
+  :group 'ediff)
+
+(defgroup ediff-merge nil
+  "Merging utilities"
+  :prefix "ediff-"
+  :group 'ediff)
+
+(defgroup ediff-hook nil
+  "Hooks called by Ediff"
+  :prefix "ediff-"
+  :group 'ediff)
+
 ;; Hook variables
 
 (defcustom ediff-before-setup-windows-hook nil
@@ -353,74 +376,74 @@ that Ediff doesn't know about.")
 This can be used to save the previous window config, which can be restored
 on ediff-quit or ediff-suspend."
   :type 'hook
-  :group 'ediff) 
+  :group 'ediff-hook
 (defcustom ediff-after-setup-windows-hook nil
   "*Hooks to run after Ediff sets its window configuration. 
 This can be used to set up control window or icon in a desired place."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 (defcustom ediff-before-setup-control-frame-hook nil
   "*Hooks run before setting up the frame to display Ediff Control Panel.
 Can be used to change control frame parameters to position it where it
 is desirable."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 (defcustom ediff-after-setup-control-frame-hook nil
   "*Hooks run after setting up the frame to display Ediff Control Panel.
 Can be used to move the frame where it is desired."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 (defcustom ediff-startup-hook nil
   "*Hooks to run in the control buffer after Ediff has been set up."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 (defcustom ediff-select-hook nil
   "*Hooks to run after a difference has been selected."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 (defcustom ediff-unselect-hook nil
   "*Hooks to run after a difference has been unselected."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 (defcustom ediff-prepare-buffer-hook  nil
   "*Hooks called after buffers A, B, and C are set up."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 (defcustom ediff-load-hook nil
   "*Hook run after Ediff is loaded.  Can be used to change defaults."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
   
 (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
 set local variables that determine how the display looks like."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 (defcustom ediff-keymap-setup-hook nil
   "*Hook run just after the default bindings in Ediff keymap are set up."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
   
 (defcustom ediff-display-help-hook nil
   "*Hooks run after preparing the help message."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 
 (defcustom ediff-suspend-hook (list 'ediff-default-suspend-function)
   "*Hooks to run in the Ediff control buffer when Ediff is suspended."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 (defcustom ediff-quit-hook (list 'ediff-cleanup-mess)
   "*Hooks to run in the Ediff control buffer after finishing Ediff."
   :type 'hook
-  :group 'ediff) 
+  :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."
   :type 'hook
-  :group 'ediff)
+  :group 'ediff-hook)
 
 ;; Error messages
 (defconst ediff-KILLED-VITAL-BUFFER
@@ -511,13 +534,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
@@ -554,10 +578,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
@@ -804,35 +831,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."
@@ -847,28 +845,7 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
   (if (and (ediff-has-face-support-p) ediff-emacs-p)
       (add-to-list 'facemenu-unlisted-faces face)))
       
-(defgroup ediff-highlighting nil
-  "Hilighting of difference regions in Ediff"
-  :prefix "ediff-"
-  :group 'ediff)
 
-;;(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"))
@@ -877,7 +854,11 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+widget to customize the actual face object `ediff-current-diff-face-A'
+this variable represents.")
 (ediff-hide-face 'ediff-current-diff-face-A)
 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
 ;; This means that some user customization may be trashed.
@@ -888,24 +869,6 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
 
 
 
-;;(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)))
@@ -913,7 +876,11 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+widget to customize the actual face `ediff-current-diff-face-B'
+this variable represents.")
 (ediff-hide-face 'ediff-current-diff-face-B)
 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
 ;; This means that some user customization may be trashed.
@@ -922,23 +889,6 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
         (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"))
@@ -947,7 +897,11 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+widget to customize the actual face object `ediff-current-diff-face-C'
+this variable represents.")
 (ediff-hide-face 'ediff-current-diff-face-C)
 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
 ;; This means that some user customization may be trashed.
@@ -956,15 +910,6 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
         (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"))
@@ -973,7 +918,11 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+widget to customize the actual face object `ediff-current-diff-face-Ancestor'
+this variable represents.")
 (ediff-hide-face 'ediff-current-diff-face-Ancestor)
 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
 ;; This means that some user customization may be trashed.
@@ -982,31 +931,6 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
         (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"))
@@ -1015,30 +939,12 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+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"))
@@ -1047,31 +953,12 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+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"))
@@ -1080,30 +967,12 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+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"))
@@ -1114,143 +983,68 @@ ancestor buffer."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+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.")
 
 (defface ediff-even-diff-face-A
   '((((class color)) (:foreground "Black" :background "light grey"))
-    (t (:italic t :stipple "Stipple")))
+    (t (:italic t :stipple "stipple")))
   "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,
 ;; this variable is set to nil, then again to the appropriate face.
-(defvar ediff-even-diff-face-A 'ediff-even-diff-face-A)
+(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
+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")))
+    (t (:italic t :stipple "stipple")))
   "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,
 ;; this variable is set to nil, then again to the appropriate face.
-(defvar ediff-even-diff-face-B 'ediff-even-diff-face-B)
+(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
+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")))
+    (t (:italic t :stipple "stipple")))
   "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,
 ;; this variable is set to nil, then again to the appropriate face.
-(defvar ediff-even-diff-face-C 'ediff-even-diff-face-C)
+(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
+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")))
+    (t (:italic t :stipple "stipple")))
   "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,
 ;; this variable is set to nil, then again to the appropriate face.
-(defvar ediff-even-diff-face-Ancestor 'ediff-even-diff-face-Ancestor)
+(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
+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
@@ -1259,24 +1053,6 @@ ancestor buffer."
     (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")))
@@ -1284,33 +1060,13 @@ ancestor buffer."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+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"))
@@ -1319,26 +1075,12 @@ ancestor buffer."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+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"))
@@ -1347,26 +1089,12 @@ ancestor buffer."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+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"))
@@ -1375,14 +1103,12 @@ ancestor buffer."
   :group 'ediff-highlighting)
 ;; 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)
+(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
+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
@@ -1459,11 +1185,15 @@ This property can be toggled interactively."
 ;; if nil, this silences some messages
 (defconst ediff-verbose-p t)
 
-(ediff-defvar-local ediff-autostore-merges  'group-jobs-only
+(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
 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'.")
+as `ediff-merge-directory' or `ediff-merge-directory-revisions'."
+  :type '(choice (const nil) (const t)
+                (other :tag "group-jobs-only" 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
 (ediff-defvar-local ediff-merge-store-file nil "")
@@ -1474,31 +1204,25 @@ Instead, C-h would jump to previous difference."
   :type 'boolean
   :group 'ediff)
   
-(defvar 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 on VMS.
-    (setq d (file-name-as-directory (directory-file-name d)))
-    )
+(defcustom ediff-temp-file-prefix
+  (file-name-as-directory temporary-file-directory)
   "*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)
 
-(defvar ediff-temp-file-mode 384       ; u=rw only
-  "*Mode for Ediff temporary files.")
+(defcustom ediff-temp-file-mode 384    ; u=rw only
+  "*Mode for Ediff temporary files."
+  :type 'integer
+  :group 'ediff)
   
 ;; Metacharacters that have to be protected from the shell when executing
 ;; a diff/diff3 command.
-(defvar ediff-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]"
-  "Characters that must be quoted with \\ when used in a shell command line.
-More precisely, a regexp to match any one such character.")
+(defcustom ediff-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]"
+  "Regexp that matches characters that must be quoted with `\\' in shell command line.
+This default should work without changes."
+  :type 'string
+  :group 'ediff)
 
 ;; needed to simulate frame-char-width in XEmacs.
 (defvar ediff-H-glyph (if ediff-xemacs-p (make-glyph "H")))