aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/ediff-diff.el
diff options
context:
space:
mode:
authorMichael Kifer2007-11-02 06:03:12 +0000
committerMichael Kifer2007-11-02 06:03:12 +0000
commit33468a59c6b42e489bc8ae147c43818d8b76a2a7 (patch)
tree22f2abf83551c006bcc231dcb890e1dac202f48c /lisp/ediff-diff.el
parent246a4316dea32514edf84e9e2552627327149160 (diff)
downloademacs-33468a59c6b42e489bc8ae147c43818d8b76a2a7.tar.gz
emacs-33468a59c6b42e489bc8ae147c43818d8b76a2a7.zip
2007-11-02 Michael Kifer <kifer@cs.stonybrook.edu>
* viper-ex.el (viper-ex): do not ignore the region. * viper-cmd.el (viper-prev-destructive-command) (viper-insert-prev-from-insertion-ring): use ring-copy instead of copy-sequence. * ediff-util.el (ediff-make-current-diff-overlay): do not use face-name. Got rid of ediff-copy-list. * ediff-diff.el (ediff-set-fine-diff-properties-in-one-buffer): do not use face-name. (ediff-test-utility,ediff-diff-mandatory-option) (ediff-reset-diff-options): removed to simplify yhe mandatory option handling on windows. (ediff-set-diff-options): added. (ediff-diff-options): changed. * ediff-vers.el (ediff-vc-internal): use ediff-vc-revision-other-window. (ediff-vc-merge-internal): use ediff-vc-revision-other-window and ediff-vc-working-revision. Require vc-hooks.
Diffstat (limited to 'lisp/ediff-diff.el')
-rw-r--r--lisp/ediff-diff.el59
1 files changed, 14 insertions, 45 deletions
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el
index 451f87e142d..06d7b603440 100644
--- a/lisp/ediff-diff.el
+++ b/lisp/ediff-diff.el
@@ -48,7 +48,6 @@
48 :prefix "ediff-" 48 :prefix "ediff-"
49 :group 'ediff) 49 :group 'ediff)
50 50
51;; these two must be here to prevent ediff-test-utility from barking
52(defcustom ediff-diff-program "diff" 51(defcustom ediff-diff-program "diff"
53 "*Program to use for generating the differential of the two files." 52 "*Program to use for generating the differential of the two files."
54 :type 'string 53 :type 'string
@@ -62,46 +61,8 @@ Must produce output compatible with Unix's diff3 program."
62 61
63;; The following functions must precede all defcustom-defined variables. 62;; The following functions must precede all defcustom-defined variables.
64 63
65;; The following functions needed for setting diff/diff3 options
66;; test if diff supports the --binary option
67(defsubst ediff-test-utility (diff-util option &optional files)
68 (condition-case nil
69 (eq 0 (apply 'call-process
70 (append (list diff-util nil nil nil option) files)))
71 (error (format "Cannot execute program %S." diff-util)))
72 )
73
74(defun ediff-diff-mandatory-option (diff-util)
75 (let ((file (if (boundp 'null-device) null-device "/dev/null")))
76 (cond ((not (memq system-type '(ms-dos windows-nt windows-95)))
77 "")
78 ((and (string= diff-util ediff-diff-program)
79 (ediff-test-utility
80 ediff-diff-program "--binary" (list file file)))
81 "--binary ")
82 ((and (string= diff-util ediff-diff3-program)
83 (ediff-test-utility
84 ediff-diff3-program "--binary" (list file file file)))
85 "--binary ")
86 (t ""))))
87
88
89;; must be before ediff-reset-diff-options to avoid compiler errors
90(fset 'ediff-set-actual-diff-options '(lambda () nil)) 64(fset 'ediff-set-actual-diff-options '(lambda () nil))
91 65
92;; make sure that mandatory options are added even if the user changes
93;; ediff-diff-options or ediff-diff3-options in the customization widget
94(defun ediff-reset-diff-options (symb val)
95 (let* ((diff-program
96 (if (eq symb 'ediff-diff-options)
97 ediff-diff-program
98 ediff-diff3-program))
99 (mandatory-option (ediff-diff-mandatory-option diff-program)))
100 (set symb (concat mandatory-option val))
101 (ediff-set-actual-diff-options)
102 ))
103
104
105(defcustom ediff-shell 66(defcustom ediff-shell
106 (cond ((eq system-type 'emx) "cmd") ; OS/2 67 (cond ((eq system-type 'emx) "cmd") ; OS/2
107 ((memq system-type '(ms-dos windows-nt windows-95)) 68 ((memq system-type '(ms-dos windows-nt windows-95))
@@ -130,17 +91,25 @@ are `-I REGEXP', to ignore changes whose lines match the REGEXP."
130 :type '(repeat string) 91 :type '(repeat string)
131 :group 'ediff-diff) 92 :group 'ediff-diff)
132 93
133(defcustom ediff-diff-options "" 94(defun ediff-set-diff-options (symbol value)
95 (set symbol value)
96 (ediff-set-actual-diff-options))
97
98(defcustom ediff-diff-options
99 (if (memq system-type '(ms-dos windows-nt windows-95)) "--binary" "")
134 "*Options to pass to `ediff-diff-program'. 100 "*Options to pass to `ediff-diff-program'.
135If Unix diff is used as `ediff-diff-program', 101If Unix diff is used as `ediff-diff-program',
136then a useful option is `-w', to ignore space. 102then a useful option is `-w', to ignore space.
137Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be 103Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be
138toggled interactively using \\[ediff-toggle-ignore-case]. 104toggled interactively using \\[ediff-toggle-ignore-case].
139 105
106Do not remove the default options. If you need to change this variable, add new
107options after the default ones.
108
140This variable is not for customizing the look of the differences produced by 109This variable is not for customizing the look of the differences produced by
141the command \\[ediff-show-diff-output]. Use the variable 110the command \\[ediff-show-diff-output]. Use the variable
142`ediff-custom-diff-options' for that." 111`ediff-custom-diff-options' for that."
143 :set 'ediff-reset-diff-options 112 :set 'ediff-set-diff-options
144 :type 'string 113 :type 'string
145 :group 'ediff-diff) 114 :group 'ediff-diff)
146 115
@@ -179,7 +148,7 @@ This output is not used by Ediff internally."
179 "Pattern to match lines produced by diff3 that describe differences.") 148 "Pattern to match lines produced by diff3 that describe differences.")
180(defcustom ediff-diff3-options "" 149(defcustom ediff-diff3-options ""
181 "*Options to pass to `ediff-diff3-program'." 150 "*Options to pass to `ediff-diff3-program'."
182 :set 'ediff-reset-diff-options 151 :set 'ediff-set-diff-options
183 :type 'string 152 :type 'string
184 :group 'ediff-diff) 153 :group 'ediff-diff)
185 154
@@ -889,9 +858,9 @@ one optional arguments, diff-number to refine.")
889 (let ((fine-diff-vector (ediff-get-fine-diff-vector n buf-type)) 858 (let ((fine-diff-vector (ediff-get-fine-diff-vector n buf-type))
890 (face (if default 859 (face (if default
891 'default 860 'default
892 (face-name 861 (ediff-get-symbol-from-alist
893 (ediff-get-symbol-from-alist 862 buf-type ediff-fine-diff-face-alist)
894 buf-type ediff-fine-diff-face-alist)))) 863 ))
895 (priority (if default 864 (priority (if default
896 0 865 0
897 (1+ (or (ediff-overlay-get 866 (1+ (or (ediff-overlay-get