Changeset 4098 for trunk/lisp/ediff-diff.el
- Timestamp:
- 07/01/06 08:27:06 (2 years ago)
- Files:
-
- trunk/lisp/ediff-diff.el (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/ediff-diff.el
r4058 r4098 66 66 ;; test if diff supports the --binary option 67 67 (defsubst ediff-test-utility (diff-util option &optional files) 68 (eq 0 (apply 'call-process 69 (append (list diff-util nil nil nil option) 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 ) 70 73 71 74 (defun ediff-diff-mandatory-option (diff-util) … … 76 79 (ediff-test-utility 77 80 ediff-diff-program "--binary" (list file file))) 78 "--binary ")81 "--binary ") 79 82 ((and (string= diff-util ediff-diff3-program) 80 83 (ediff-test-utility 81 84 ediff-diff3-program "--binary" (list file file file))) 82 "--binary ")85 "--binary ") 83 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)) 84 91 85 92 ;; make sure that mandatory options are added even if the user changes … … 90 97 ediff-diff-program 91 98 ediff-diff3-program)) 92 (mandatory-option (ediff-diff-mandatory-option diff-program)) 93 (spacer (if (string-equal mandatory-option "") "" " "))) 94 (set symb 95 (if (string-match mandatory-option val) 96 val 97 (concat mandatory-option spacer val))) 99 (mandatory-option (ediff-diff-mandatory-option diff-program))) 100 (set symb (concat mandatory-option val)) 101 (ediff-set-actual-diff-options) 98 102 )) 99 103 … … 129 133 (defcustom ediff-diff-options "" 130 134 "*Options to pass to `ediff-diff-program'. 131 If Unix diff is used as `ediff-diff-program', then a useful option is132 `-w', to ignore space, and `-i', to ignore case of letters.133 Options `-c' and `-i' are not allowed. Case sensitivity can be toggled134 interactively using [ediff-toggle-ignore-case]"135 If Unix diff is used as `ediff-diff-program', 136 then a useful option is `-w', to ignore space. 137 Options `-c' and `-i' are not allowed. Case sensitivity can be 138 toggled interactively using \\[ediff-toggle-ignore-case]." 135 139 :set 'ediff-reset-diff-options 136 140 :type 'string … … 154 158 155 159 ;; the actual options used in comparison 156 (ediff-defvar-local ediff-actual-diff-options """")160 (ediff-defvar-local ediff-actual-diff-options ediff-diff-options "") 157 161 158 162 (defcustom ediff-custom-diff-program ediff-diff-program … … 177 181 178 182 ;; the actual options used in comparison 179 (ediff-defvar-local ediff-actual-diff3-options """")183 (ediff-defvar-local ediff-actual-diff3-options ediff-diff3-options "") 180 184 181 185 (defcustom ediff-diff3-ok-lines-regexp … … 400 404 diff-list shift-A shift-B 401 405 ) 402 406 403 407 ;; diff list contains word numbers, unless changed later 404 408 (setq diff-list (cons (if word-mode 'words 'points) … … 412 416 (ediff-overlay-start 413 417 (ediff-get-value-according-to-buffer-type 'B bounds)))) 414 418 415 419 ;; reset point in buffers A/B/C 416 420 (ediff-with-current-buffer A-buffer … … 1271 1275 ;; In DOS, must synchronize because DOS doesn't have 1272 1276 ;; asynchronous processes. 1273 (apply 'call-process program nil buffer nil args) 1277 (condition-case nil 1278 (apply 'call-process program nil buffer nil args) 1279 (error (format "Cannot execute program %S." program))) 1274 1280 ;; On other systems, do it asynchronously. 1275 1281 (setq proc (get-buffer-process buffer)) … … 1327 1333 (make-variable-buffer-local 'ediff-forward-word-function) 1328 1334 1329 (defvar ediff-whitespace " \n\t\f" 1335 ;; \240 is unicode symbol for nonbreakable whitespace 1336 (defvar ediff-whitespace " \n\t\f\r\240" 1330 1337 "*Characters constituting white space. 1331 1338 These characters are ignored when differing regions are split into words.") … … 1441 1448 (if (and (not (file-directory-p f1)) 1442 1449 (not (file-directory-p f2))) 1443 (let ((res 1444 (apply 'call-process ediff-cmp-program nil nil nil 1445 (append ediff-cmp-options (list f1 f2))))) 1446 (and (numberp res) (eq res 0)))) 1447 ) 1450 (condition-case nil 1451 (let ((res 1452 (apply 'call-process ediff-cmp-program nil nil nil 1453 (append ediff-cmp-options (list f1 f2))))) 1454 (and (numberp res) (eq res 0))) 1455 (error (format "Cannot execute program %S." ediff-cmp-program))) 1456 )) 1448 1457 1449 1458 … … 1520 1529 (reverse result))) 1521 1530 1531 1532 (defun ediff-set-actual-diff-options () 1533 (if ediff-ignore-case 1534 (setq ediff-actual-diff-options 1535 (concat ediff-diff-options " " ediff-ignore-case-option) 1536 ediff-actual-diff3-options 1537 (concat ediff-diff3-options " " ediff-ignore-case-option3)) 1538 (setq ediff-actual-diff-options ediff-diff-options 1539 ediff-actual-diff3-options ediff-diff3-options) 1540 ) 1541 (setq-default ediff-actual-diff-options ediff-actual-diff-options 1542 ediff-actual-diff3-options ediff-actual-diff3-options) 1543 ) 1544 1545 1522 1546 ;; Ignore case handling - some ideas from drew.adams@@oracle.com 1523 1547 (defun ediff-toggle-ignore-case () … … 1525 1549 (ediff-barf-if-not-control-buffer) 1526 1550 (setq ediff-ignore-case (not ediff-ignore-case)) 1527 (cond (ediff-ignore-case 1528 (setq ediff-actual-diff-options 1529 (concat ediff-diff-options " " ediff-ignore-case-option) 1530 ediff-actual-diff3-options 1531 (concat ediff-diff3-options " " ediff-ignore-case-option3)) 1532 (message "Ignoring regions that differ only in case")) 1533 (t 1534 (setq ediff-actual-diff-options ediff-diff-options 1535 ediff-actual-diff3-options ediff-diff3-options) 1536 (message "Ignoring case differences turned OFF"))) 1551 (ediff-set-actual-diff-options) 1552 (if ediff-ignore-case 1553 (message "Ignoring regions that differ only in case") 1554 (message "Ignoring case differences turned OFF")) 1537 1555 (cond (ediff-merge-job 1538 1556 (message "Ignoring letter case is too dangerous in merge jobs"))
