;;; ediff-util.el --- the core commands and utilities of ediff
;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-;; 2003, 2004, 2005 Free Software Foundation, Inc.
+;; 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
;;; Code:
-(provide 'ediff-util)
;; Compiler pacifier
(defvar ediff-patch-diagnostics)
(eval-when-compile
(let ((load-path (cons (expand-file-name ".") load-path)))
+ (provide 'ediff-util) ; to break recursive load cycle
(or (featurep 'ediff-init)
(load "ediff-init.el" nil nil 'nosuffix))
(or (featurep 'ediff-help)
(define-key ediff-mode-map "#" nil)
(define-key ediff-mode-map "#h" 'ediff-toggle-regexp-match)
(define-key ediff-mode-map "#f" 'ediff-toggle-regexp-match)
+ (define-key ediff-mode-map "#c" 'ediff-toggle-ignore-case)
(or ediff-word-mode
(define-key ediff-mode-map "##" 'ediff-toggle-skip-similar))
(define-key ediff-mode-map "o" nil)
;; ))
-(defsubst ediff-file-checked-out-p (file)
+(defun ediff-file-checked-out-p (file)
(or (not (featurep 'vc-hooks))
(and (vc-backend file)
(if (fboundp 'vc-state)
(vc-locking-user file))
)))
-(defsubst ediff-file-checked-in-p (file)
+(defun ediff-file-checked-in-p (file)
(and (featurep 'vc-hooks)
;; CVS files are considered not checked in
(not (memq (vc-backend file) '(nil CVS)))
skip-changed
;; skip difference regions that differ in white space
(and ediff-ignore-similar-regions
+ (ediff-merge-region-is-non-clash n)
(or (eq (ediff-no-fine-diffs-p n) t)
(and (ediff-merge-job)
(eq (ediff-no-fine-diffs-p n) 'C)))
)))
-(defsubst ediff-highlight-diff (n)
+(defun ediff-highlight-diff (n)
"Put face on diff N. Invoked for X displays only."
(ediff-highlight-diff-in-one-buffer n 'A)
(ediff-highlight-diff-in-one-buffer n 'B)
)
-(defsubst ediff-unhighlight-diff ()
+(defun ediff-unhighlight-diff ()
"Remove overlays from buffers A, B, and C."
(ediff-unhighlight-diff-in-one-buffer 'A)
(ediff-unhighlight-diff-in-one-buffer 'B)
)
;; delete highlighting overlays, restore faces to their original form
-(defsubst ediff-unhighlight-diffs-totally ()
+(defun ediff-unhighlight-diffs-totally ()
(ediff-unhighlight-diffs-totally-in-one-buffer 'A)
(ediff-unhighlight-diffs-totally-in-one-buffer 'B)
(ediff-unhighlight-diffs-totally-in-one-buffer 'C)
(setq f (concat ediff-temp-file-prefix p)
short-f (concat ediff-temp-file-prefix short-p)
f (cond (given-file)
- ((find-file-name-handler f 'find-file-noselect)
+ ((find-file-name-handler f 'insert-file-contents)
;; to thwart file handlers in write-region, e.g., if file
;; name ends with .Z or .gz
;; This is needed so that patches produced by ediff will
(>= (point) end))))))
-(defsubst ediff-get-region-contents (n buf-type ctrl-buf &optional start end)
+(defun ediff-get-region-contents (n buf-type ctrl-buf &optional start end)
(ediff-with-current-buffer
(ediff-with-current-buffer ctrl-buf (ediff-get-buffer buf-type))
(buffer-substring
(ediff-device-type (ediff-device-type))
varlist salutation buffer-name)
(setq varlist '(ediff-diff-program ediff-diff-options
+ ediff-diff3-program ediff-diff3-options
ediff-patch-program ediff-patch-options
ediff-shell
ediff-use-faces
(setq lis1 (cdr lis1)))
(cdr result)))
+(defun ediff-add-to-history (history-var newelt)
+ (if (fboundp 'add-to-history)
+ (add-to-history history-var newelt)
+ (set history-var (cons newelt (symbol-value history-var)))))
+
(if (fboundp 'copy-sequence)
(defalias 'ediff-copy-list 'copy-sequence)
(defun ediff-copy-list (list)
(run-hooks 'ediff-load-hook)
+(provide 'ediff-util)
+
;;; Local Variables:
;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)