;;; ediff-init.el --- Macros, variables, and defsubsts used by Ediff
-;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02, 04 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
(ediff-force-faces)
((ediff-color-display-p))
(ediff-emacs-p (memq (ediff-device-type) '(pc)))
- (ediff-xemacs-p (memq (ediff-device-type) '(tty pc)))))
+ (ediff-xemacs-p (memq (ediff-device-type) '(tty pc)))
+ ))
;; toolbar support for emacs hasn't been implemented in ediff
(defun ediff-has-toolbar-support-p ()
ediff-merge-revisions-with-ancestor)))
(ediff-defvar-local ediff-merge-job nil "")
+(defmacro ediff-patch-job ()
+ `(eq ediff-job-name 'epatch))
+
(defmacro ediff-merge-with-ancestor-job ()
`(memq
ediff-job-name
(ediff-patch-metajob metajob)
;; add more here
))
+;; jobs suitable for the operation of collecting diffs into a multifile patch
(defsubst ediff-collect-diffs-metajob (&optional metajob)
(memq (or metajob ediff-metajob-name)
'(ediff-directories
- ediff-directory-revisions
ediff-merge-directories
ediff-merge-directories-with-ancestor
+ ediff-directory-revisions
ediff-merge-directory-revisions
ediff-merge-directory-revisions-with-ancestor
;; add more here
: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
-;; unhighlighted, `off' -- turned off \(on a dumb terminal only\).
-(ediff-defvar-local ediff-highlighting-style nil "")
-
;; The suffix of the control buffer name.
(ediff-defvar-local ediff-control-buffer-suffix nil "")
:group 'ediff)
(defcustom ediff-coding-system-for-read 'raw-text
- "*The coding system for read to use when running the diff program as a subprocess.
+ "*The coding system for read to use when running the diff program as a subprocess.
In most cases, the default will do. However, under certain circumstances in
Windows NT/98/95 you might need to use something like 'raw-text-dos here.
So, if the output that your diff program sends to Emacs contains extra ^M's,
(ediff-cond-compile-for-xemacs-or-emacs
(progn ; xemacs
- (fset 'ediff-read-event (symbol-function 'next-command-event))
- (fset 'ediff-overlayp (symbol-function 'extentp))
- (fset 'ediff-make-overlay (symbol-function 'make-extent))
- (fset 'ediff-delete-overlay (symbol-function 'delete-extent)))
+ (defalias 'ediff-read-event 'next-command-event)
+ (defalias 'ediff-overlayp 'extentp)
+ (defalias 'ediff-make-overlay 'make-extent)
+ (defalias 'ediff-delete-overlay 'delete-extent))
(progn ; emacs
- (fset 'ediff-read-event (symbol-function 'read-event))
- (fset 'ediff-overlayp (symbol-function 'overlayp))
- (fset 'ediff-make-overlay (symbol-function 'make-overlay))
- (fset 'ediff-delete-overlay (symbol-function 'delete-overlay)))
+ (defalias 'ediff-read-event 'read-event)
+ (defalias 'ediff-overlayp 'overlayp)
+ (defalias 'ediff-make-overlay 'make-overlay)
+ (defalias 'ediff-delete-overlay 'delete-overlay))
)
;; Check the current version against the major and minor version numbers
(error nil)))
+;; A var local to each control panel buffer. Indicates highlighting style
+;; in effect for this buffer: `face', `ascii',
+;; `off' -- turned off \(on a dumb terminal only\).
+(ediff-defvar-local ediff-highlighting-style
+ (if (and (ediff-has-face-support-p) ediff-use-faces) 'face 'ascii)
+ "")
+
+
(if (ediff-has-face-support-p)
(ediff-cond-compile-for-xemacs-or-emacs
(progn ; xemacs
(if (ediff-window-display-p)
(ediff-cond-compile-for-xemacs-or-emacs
(progn ; xemacs
- (fset 'ediff-display-pixel-width (symbol-function 'device-pixel-width))
- (fset 'ediff-display-pixel-height
- (symbol-function 'device-pixel-height)))
+ (defalias 'ediff-display-pixel-width 'device-pixel-width)
+ (defalias 'ediff-display-pixel-height 'device-pixel-height))
(progn ; emacs
- (fset 'ediff-display-pixel-width
+ (defalias 'ediff-display-pixel-width
(if (fboundp 'display-pixel-width)
- (symbol-function 'display-pixel-width)
- (symbol-function 'x-display-pixel-width)))
- (fset 'ediff-display-pixel-height
+ 'display-pixel-width
+ 'x-display-pixel-width))
+ (defalias 'ediff-display-pixel-height
(if (fboundp 'display-pixel-height)
- (symbol-function 'display-pixel-height)
- (symbol-function 'x-display-pixel-height))))
+ 'display-pixel-height
+ 'x-display-pixel-height)))
))
;; A-list of current-diff-overlay symbols associated with buf types
(sit-for 1)))))
(defun ediff-hide-face (face)
- (if (and (ediff-has-face-support-p) ediff-emacs-p)
+ (if (and (ediff-has-face-support-p) (boundp 'add-to-list)
+ (boundp 'facemenu-unlisted-faces))
(add-to-list 'facemenu-unlisted-faces face)))
(defface ediff-current-diff-face-A
- '((((class color)) (:foreground "firebrick" :background "pale green"))
- (t (:inverse-video t)))
+ '((((type tty)) (:foreground "blue3" :background "yellow3"))
+ (((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,
(defface ediff-current-diff-face-B
- '((((class color)) (:foreground "DarkOrchid" :background "Yellow"))
- (t (:inverse-video t)))
+ '((((type tty)) (:foreground "magenta3" :background "yellow3"
+ :weight bold))
+ (((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,
(defface ediff-current-diff-face-C
- '((((class color)) (:foreground "Navy" :background "Pink"))
- (t (:inverse-video t)))
+ '((((type tty)) (:foreground "cyan3" :background "yellow3" :weight bold))
+ (((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,
(defface ediff-current-diff-face-Ancestor
- '((((class color)) (:foreground "Black" :background "VioletRed"))
+ '((((type tty)) (:foreground "black" :background "magenta3"))
+ (((class color)) (:foreground "Black" :background "VioletRed"))
(t (:inverse-video t)))
"Face for highlighting the selected difference in buffer Ancestor."
:group 'ediff-highlighting)
(defface ediff-fine-diff-face-A
- '((((class color)) (:foreground "Navy" :background "sky blue"))
+ '((((type tty)) (:foreground "white" :background "sky blue" :weight bold))
+ (((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)
(ediff-hide-face 'ediff-fine-diff-face-A)
(defface ediff-fine-diff-face-B
- '((((class color)) (:foreground "Black" :background "cyan"))
- (t (:underline t :stipple "gray3")))
+ '((((type tty)) (:foreground "magenta3" :background "cyan3"))
+ (((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,
(ediff-hide-face 'ediff-fine-diff-face-B)
(defface ediff-fine-diff-face-C
- '((((class color)) (:foreground "Black" :background "Turquoise"))
+ '((((type tty)) (:foreground "yellow3" :background "Turquoise"
+ :weight bold))
+ (((type pc)) (:foreground "white" :background "Turquoise"))
+ (((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)
(ediff-hide-face 'ediff-fine-diff-face-C)
(defface ediff-fine-diff-face-Ancestor
- '((((class color)) (:foreground "Black" :background "Green"))
- (t (:underline t :stipple "gray3")))
+ '((((type tty)) (:foreground "red3" :background "green"))
+ (((class color)) (:foreground "Black" :background "Green"))
+ (t (:underline t :stipple "gray3")))
"Face for highlighting the refinement of the selected diff in the ancestor buffer.
At present, this face is not used and no fine differences are computed for the
ancestor buffer."
(t "Stipple")))
(defface ediff-even-diff-face-A
- `((((class color)) (:foreground "Black" :background "light grey"))
- (t (:italic t :stipple ,stipple-pixmap)))
+ `((((type tty)) (:foreground "red3" :background "light grey"
+ :weight bold))
+ (((type pc)) (:foreground "green3" :background "light grey"))
+ (((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,
(ediff-hide-face 'ediff-even-diff-face-A)
(defface ediff-even-diff-face-B
- `((((class color)) (:foreground "White" :background "Grey"))
- (t (:italic t :stipple ,stipple-pixmap)))
+ `((((type tty)) (:foreground "blue3" :background "Grey" :weight bold))
+ (((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,
(ediff-hide-face 'ediff-even-diff-face-B)
(defface ediff-even-diff-face-C
- `((((class color)) (:foreground "Black" :background "light grey"))
- (t (:italic t :stipple ,stipple-pixmap)))
+ `((((type tty)) (:foreground "yellow3" :background "light grey"
+ :weight bold))
+ (((type pc)) (:foreground "yellow3" :background "light grey"))
+ (((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,
(ediff-hide-face 'ediff-even-diff-face-C)
(defface ediff-even-diff-face-Ancestor
- `((((class color)) (:foreground "White" :background "Grey"))
+ `((((type tty)) (:foreground "cyan3" :background "light grey"
+ :weight bold))
+ (((type pc)) (:foreground "cyan3" :background "light grey"))
+ (((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)
(Ancestor . ediff-even-diff-face-Ancestor)))
(defface ediff-odd-diff-face-A
- '((((class color)) (:foreground "White" :background "Grey"))
- (t (:italic t :stipple "gray1")))
+ '((((type tty)) (:foreground "red3" :background "black" :weight bold))
+ (((type pc)) (:foreground "green3" :background "gray40"))
+ (((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,
(defface ediff-odd-diff-face-B
- '((((class color)) (:foreground "Black" :background "light grey"))
- (t (:italic t :stipple "gray1")))
+ '((((type tty)) (:foreground "cyan3" :background "black" :weight bold))
+ (((type pc)) (:foreground "White" :background "gray40"))
+ (((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,
(ediff-hide-face 'ediff-odd-diff-face-B)
(defface ediff-odd-diff-face-C
- '((((class color)) (:foreground "White" :background "Grey"))
- (t (:italic t :stipple "gray1")))
+ '((((type tty)) (:foreground "yellow3" :background "black" :weight bold))
+ (((type pc)) (:foreground "yellow3" :background "gray40"))
+ (((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,
(ediff-hide-face 'ediff-odd-diff-face-C)
(defface ediff-odd-diff-face-Ancestor
- '((((class color)) (:foreground "Black" :background "light grey"))
- (t (:italic t :stipple "gray1")))
+ '((((type tty)) (:foreground "green3" :background "black" :weight bold))
+ (((class color)) (:foreground "cyan3" :background "gray40"))
+ (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,
;;; Misc
;; if nil, this silences some messages
-(defconst ediff-verbose-p t)
+(defvar ediff-verbose-p t)
(defcustom ediff-autostore-merges 'group-jobs-only
"*Save the results of merge jobs automatically.
(cdr (assq 'unsplittable (frame-parameters frame))))
(defsubst ediff-get-next-window (wind prev-wind)
- (or (window-live-p wind)
- (setq wind (if prev-wind
- (next-window wind)
- (selected-window)))))
+ (cond ((window-live-p wind) wind)
+ (prev-wind (next-window wind))
+ (t (selected-window))
+ ))
(defsubst ediff-kill-buffer-carefully (buf)
(t nil))))
(defsubst ediff-frame-char-height (frame)
- (ediff-cond-compile-for-xemacs-or-emacs
- (glyph-height ediff-H-glyph (selected-window frame)) ; xemacs cse
+ (ediff-cond-compile-for-xemacs-or-emacs
+ (glyph-height ediff-H-glyph (frame-selected-window frame)) ; xemacs case
(frame-char-height frame) ; emacs case
)
)
(if (fboundp 'with-syntax-table)
- (fset 'ediff-with-syntax-table 'with-syntax-table)
+ (defalias 'ediff-with-syntax-table 'with-syntax-table)
;; stolen from subr.el in emacs 21
(defmacro ediff-with-syntax-table (table &rest body)
(let ((old-table (make-symbol "table"))
(provide 'ediff-init)
+;;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5
;;; ediff-init.el ends here