Show
Ignore:
Timestamp:
07/01/06 08:27:06 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/ediff-diff.el

    r4058 r4098  
    6666;; test if diff supports the --binary option 
    6767(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  ) 
    7073 
    7174(defun ediff-diff-mandatory-option (diff-util) 
     
    7679                 (ediff-test-utility 
    7780                  ediff-diff-program "--binary" (list file file))) 
    78             "--binary") 
     81            "--binary ") 
    7982           ((and (string= diff-util ediff-diff3-program) 
    8083                 (ediff-test-utility 
    8184                  ediff-diff3-program "--binary" (list file file file))) 
    82             "--binary") 
     85            "--binary ") 
    8386           (t "")))) 
     87 
     88 
     89;; must be before ediff-reset-diff-options to avoid compiler errors 
     90(fset 'ediff-set-actual-diff-options '(lambda () nil)) 
    8491 
    8592;; make sure that mandatory options are added even if the user changes 
     
    9097              ediff-diff-program 
    9198            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) 
    98102    )) 
    99103 
     
    129133(defcustom ediff-diff-options "" 
    130134  "*Options to pass to `ediff-diff-program'. 
    131 If Unix diff is used as `ediff-diff-program', then a useful option is 
    132 `-w', to ignore space, and `-i', to ignore case of letters
    133 Options `-c' and `-i' are not allowed. Case sensitivity can be toggled 
    134 interactively using [ediff-toggle-ignore-case]
     135If Unix diff is used as `ediff-diff-program', 
     136 then a useful option is `-w', to ignore space
     137Options `-c' and `-i' are not allowed. Case sensitivity can be 
     138 toggled interactively using \\[ediff-toggle-ignore-case].
    135139  :set 'ediff-reset-diff-options 
    136140  :type 'string 
     
    154158 
    155159;; 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 "") 
    157161 
    158162(defcustom ediff-custom-diff-program ediff-diff-program 
     
    177181 
    178182;; 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 "") 
    180184 
    181185(defcustom ediff-diff3-ok-lines-regexp 
     
    400404        diff-list shift-A shift-B 
    401405        ) 
    402      
     406 
    403407    ;; diff list contains word numbers, unless changed later 
    404408    (setq diff-list (cons (if word-mode 'words 'points) 
     
    412416              (ediff-overlay-start 
    413417               (ediff-get-value-according-to-buffer-type 'B bounds)))) 
    414      
     418 
    415419    ;; reset point in buffers A/B/C 
    416420    (ediff-with-current-buffer A-buffer 
     
    12711275                ;; In DOS, must synchronize because DOS doesn't have 
    12721276                ;; 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))) 
    12741280              ;; On other systems, do it asynchronously. 
    12751281              (setq proc (get-buffer-process buffer)) 
     
    13271333(make-variable-buffer-local 'ediff-forward-word-function) 
    13281334 
    1329 (defvar ediff-whitespace " \n\t\f" 
     1335;; \240 is unicode symbol for nonbreakable whitespace 
     1336(defvar ediff-whitespace " \n\t\f\r\240" 
    13301337  "*Characters constituting white space. 
    13311338These characters are ignored when differing regions are split into words.") 
     
    14411448  (if (and (not (file-directory-p f1)) 
    14421449           (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    )) 
    14481457 
    14491458 
     
    15201529    (reverse result))) 
    15211530 
     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 
    15221546;; Ignore case handling - some ideas from drew.adams@@oracle.com 
    15231547(defun ediff-toggle-ignore-case () 
     
    15251549  (ediff-barf-if-not-control-buffer) 
    15261550  (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")) 
    15371555  (cond (ediff-merge-job 
    15381556         (message "Ignoring letter case is too dangerous in merge jobs"))