;;; Code:
+(require 'cl-lib)
+
;; Start compiler pacifier
(defvar ediff-metajob-name)
(defvar ediff-meta-buffer)
(?C . ediff-buffer-C)))
;;; Macros
-(defmacro ediff-odd-p (arg)
- `(eq (logand ,arg 1) 1))
-
-(defmacro ediff-buffer-live-p (buf)
- `(and ,buf (get-buffer ,buf) (buffer-name (get-buffer ,buf))))
+(defsubst ediff-buffer-live-p (buf)
+ (and buf (get-buffer buf) (buffer-name (get-buffer buf))))
(defmacro ediff-get-buffer (arg)
`(cond ((eq ,arg 'A) ediff-buffer-A)
highlighted using ASCII flags."
:type 'boolean
:group 'ediff-highlighting)
-(ediff-defvar-local ediff-use-faces t "")
+(make-variable-buffer-local 'ediff-use-faces)
+(put 'ediff-use-faces 'permanent-local t)
;; this indicates that diff regions are word-size, so fine diffs are
;; permanently nixed; used in ediff-windows-wordwise and ediff-regions-wordwise
shown in brighter colors."
:type 'boolean
:group 'ediff-highlighting)
-(ediff-defvar-local ediff-highlight-all-diffs t "")
+(make-variable-buffer-local 'ediff-highlight-all-diffs)
+(put 'ediff-highlight-all-diffs 'permanent-local t)
;; The suffix of the control buffer name.
;; List of difference overlays disturbed by working with the current diff.
(defvar ediff-disturbed-overlays nil "")
-;; Priority of non-selected overlays.
-(defvar ediff-shadow-overlay-priority 100 "")
-
(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
(defun ediff-set-overlay-face (extent face)
(ediff-overlay-put extent 'face face)
- (ediff-overlay-put extent 'help-echo 'ediff-region-help-echo))
+ (ediff-overlay-put extent 'help-echo (if face 'ediff-region-help-echo)))
(defun ediff-region-help-echo (extent-or-window &optional overlay _point)
(unless overlay
(defface ediff-current-diff-Ancestor
(if (featurep 'emacs)
- '((((class color) (min-colors 16))
+ '((((class color) (min-colors 88))
+ (:background "VioletRed"))
+ (((class color) (min-colors 16))
(:foreground "Black" :background "VioletRed"))
(((class color))
(:foreground "black" :background "magenta3"))
(defface ediff-fine-diff-Ancestor
(if (featurep 'emacs)
- '((((class color) (min-colors 16))
+ '((((class color) (min-colors 88))
+ (:background "Green"))
+ (((class color) (min-colors 16))
(:foreground "Black" :background "Green"))
(((class color))
(:foreground "red3" :background "green"))
(if (featurep 'emacs)
`((((type pc))
(:foreground "green3" :background "light grey"))
+ (((class color) (min-colors 88))
+ (:background "light grey"))
(((class color) (min-colors 16))
(:foreground "Black" :background "light grey"))
(((class color))
(defface ediff-even-diff-B
(if (featurep 'emacs)
- `((((class color) (min-colors 16))
+ `((((class color) (min-colors 88))
+ (:background "Grey"))
+ (((class color) (min-colors 16))
(:foreground "White" :background "Grey"))
(((class color))
(:foreground "blue3" :background "Grey" :weight bold))
(if (featurep 'emacs)
`((((type pc))
(:foreground "yellow3" :background "light grey"))
+ (((class color) (min-colors 88))
+ (:background "light grey"))
(((class color) (min-colors 16))
(:foreground "Black" :background "light grey"))
(((class color))
(if (featurep 'emacs)
`((((type pc))
(:foreground "cyan3" :background "light grey"))
+ (((class color) (min-colors 88))
+ (:background "Grey"))
(((class color) (min-colors 16))
(:foreground "White" :background "Grey"))
(((class color))
(if (featurep 'emacs)
'((((type pc))
(:foreground "green3" :background "gray40"))
+ (((class color) (min-colors 88))
+ (:background "Grey"))
(((class color) (min-colors 16))
(:foreground "White" :background "Grey"))
(((class color))
(if (featurep 'emacs)
'((((type pc))
(:foreground "White" :background "gray40"))
+ (((class color) (min-colors 88))
+ (:background "light grey"))
(((class color) (min-colors 16))
(:foreground "Black" :background "light grey"))
(((class color))
(if (featurep 'emacs)
'((((type pc))
(:foreground "yellow3" :background "gray40"))
+ (((class color) (min-colors 88))
+ (:background "Grey"))
(((class color) (min-colors 16))
(:foreground "White" :background "Grey"))
(((class color))
(defface ediff-odd-diff-Ancestor
(if (featurep 'emacs)
- '((((class color) (min-colors 16))
+ '((((class color) (min-colors 88))
+ (:background "gray40"))
+ (((class color) (min-colors 16))
(:foreground "cyan3" :background "gray40"))
(((class color))
(:foreground "green3" :background "black" :weight bold))
(ediff-defvar-local ediff-current-diff-overlay-Ancestor nil
"Overlay for the current difference region in the ancestor buffer.")
-;; Compute priority of a current ediff overlay.
-(defun ediff-highest-priority (start end buffer)
- (let ((pos (max 1 (1- start)))
- ovr-list)
- (if (featurep 'xemacs)
- (1+ ediff-shadow-overlay-priority)
- (ediff-with-current-buffer buffer
- (while (< pos (min (point-max) (1+ end)))
- (setq ovr-list (append (overlays-at pos) ovr-list))
- (setq pos (next-overlay-change pos)))
- (+ 1 ediff-shadow-overlay-priority
- (apply 'max
- (cons
- 1
- (mapcar
- (lambda (ovr)
- (if (and ovr
- ;; exclude ediff overlays from priority
- ;; calculation, or else priority will keep
- ;; increasing
- (null (ediff-overlay-get ovr 'ediff))
- (null (ediff-overlay-get ovr 'ediff-diff-num)))
- ;; use the overlay priority or 0
- (or (ediff-overlay-get ovr 'priority) 0)
- 0))
- ovr-list))))))))
-
-
-(defvar ediff-toggle-read-only-function 'toggle-read-only
+(defvar ediff-toggle-read-only-function 'read-only-mode
"Function to be used to toggle read-only status of the buffer.
If nil, Ediff tries using the command bound to C-x C-q.")
;; The value of dif-num is always 1- the one that user sees.
;; This is why even face is used when dif-num is odd.
(ediff-get-symbol-from-alist
- buf-type (if (ediff-odd-p dif-num)
+ buf-type (if (cl-oddp dif-num)
ediff-even-diff-face-alist
ediff-odd-diff-face-alist)
))