Commits

Anonymous committed d81f8fe

* ediff-diff.el (ediff-ignore-case, ediff-ignore-case-option,
ediff-ignore-case-option3, ediff-actual-diff-options,
ediff-actual-diff3-options): new variables to control case sensitivity.
(ediff-make-diff2-buffer, ediff-setup-fine-diff-regions,
ediff-setup-diff-regions3): made aware of case-sensitivity.
(ediff-toggle-ignore-case): new function.
(ediff-extract-diffs, ediff-extract-diffs3): preserve point in buffers.

* ediff-help.el (ediff-long-help-message-narrow2,
ediff-long-help-message-compare2, ediff-long-help-message-compare3,
ediff-long-help-message-word-mode): add ignore-case command.
(ediff-help-for-quick-help): add ignore-case command.

* ediff-merg.el: move provide to the end.

* ediff-ptch.el: move provide to the end.

* ediff-wind.el: move provide to the end.

* ediff-mult.el: move provide to the end.
(ediff-set-meta-overlay): enable follow-link.

* ediff.el: move provide to the end.
Break recursive load cycle in eval-when-compile.
(ediff-patch-buffer): better heuristics.

* ediff-util.el: move provide to the end.
Break recursive load cycle in eval-when-compile.
(ediff-setup-keymap): add binding for #c. Replaced some defsubsts with
defuns.
(ediff-submit-report): pass the values of ediff-diff3-program,
ediff-diff3-options.

  • Participants
  • Parent commits 618e134

Comments (0)

Files changed (14)

+2006-02-19  Michael Kifer  <kifer@cs.stonybrook.edu>
+	
+	* ediff-diff.el (ediff-ignore-case, ediff-ignore-case-option,
+	ediff-ignore-case-option3, ediff-actual-diff-options,
+	ediff-actual-diff3-options): new variables to control case sensitivity.
+	(ediff-make-diff2-buffer, ediff-setup-fine-diff-regions,
+	ediff-setup-diff-regions3): made aware of case-sensitivity.
+	(ediff-toggle-ignore-case): new function.
+	(ediff-extract-diffs, ediff-extract-diffs3): preserve point in buffers.
+	
+	* ediff-help.el (ediff-long-help-message-narrow2,
+	ediff-long-help-message-compare2, ediff-long-help-message-compare3,
+	ediff-long-help-message-word-mode): add ignore-case command.
+	(ediff-help-for-quick-help): add ignore-case command.
+	
+	* ediff-merg.el: move provide to the end.
+	
+	* ediff-ptch.el: move provide to the end.
+	
+	* ediff-wind.el: move provide to the end.
+	
+	* ediff-mult.el: move provide to the end.
+	(ediff-set-meta-overlay): enable follow-link.
+	
+	* ediff.el: move provide to the end.
+	Break recursive load cycle in eval-when-compile.
+	(ediff-patch-buffer): better heuristics.
+	
+	* ediff-util.el: move provide to the end.
+	Break recursive load cycle in eval-when-compile.
+	(ediff-setup-keymap): add binding for #c. Replaced some defsubsts with
+	defuns.
+	(ediff-submit-report): pass the values of ediff-diff3-program,
+	ediff-diff3-options.
+
 2005-12-05  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.60 released.
 ;;; ediff-diff.el --- diff-related utilities
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-;;   2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+;;   2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
 
 ;;; Code:
 
-(provide 'ediff-diff)
 
 ;; compiler pacifier
 (defvar ediff-default-variant)
 
 (defcustom ediff-diff-options ""
   "*Options to pass to `ediff-diff-program'.
-If Unix diff is used as `ediff-diff-program', then the most useful options are
+If Unix diff is used as `ediff-diff-program', then a useful option is
 `-w', to ignore space, and `-i', to ignore case of letters.
-At present, the option `-c' is not allowed."
+Options `-c' and `-i' are not allowed. Case sensitivity can be toggled
+interactively using [ediff-toggle-ignore-case]"
   :set 'ediff-reset-diff-options
   :type 'string
   :group 'ediff-diff)
 
+(ediff-defvar-local ediff-ignore-case nil
+  "*If t, skip over difference regions that differ only in letter case.
+This variable can be set either in .emacs or toggled interactively.
+Use `setq-default' if setting it in .emacs")
+
+(defcustom ediff-ignore-case-option "-i"
+  "*Option that causes the diff program to ignore case of letters."
+  :type 'string
+  :group 'ediff-diff)
+
+(defcustom ediff-ignore-case-option3 ""
+  "*Option that causes the diff3 program to ignore case of letters.
+GNU diff3 doesn't have such an option."
+  :type 'string
+  :group 'ediff-diff)
+
+;; the actual options used in comparison
+(ediff-defvar-local ediff-actual-diff-options "" "")
+
 (defcustom ediff-custom-diff-program ediff-diff-program
   "*Program to use for generating custom diff output for saving it in a file.
 This output is not used by Ediff internally."
   :set 'ediff-reset-diff-options
   :type 'string
   :group 'ediff-diff)
+
+;; the actual options used in comparison
+(ediff-defvar-local ediff-actual-diff3-options "" "")
+
 (defcustom ediff-diff3-ok-lines-regexp
   "^\\([1-3]:\\|====\\|  \\|.*Warning *:\\|.*No newline\\|.*missing newline\\|^\C-m$\\)"
   "*Regexp that matches normal output lines from `ediff-diff3-program'.
 This variable can be set either in .emacs or toggled interactively.
 Use `setq-default' if setting it in .emacs")
 
-(ediff-defvar-local ediff-auto-refine-limit 1400
+(ediff-defvar-local ediff-auto-refine-limit 14000
   "*Auto-refine only the regions of this size \(in bytes\) or less.")
 
 ;;; General
 ;; ediff-setup-diff-regions-function, which can also have the value
 ;; ediff-setup-diff-regions3, which takes 4 arguments.
 (defun ediff-setup-diff-regions (file-A file-B file-C)
-  ;; looking either for '-c' or a 'c' in a set of clustered non-long options
-  (if (string-match "^-c\\| -c\\|-[^- ]+c" ediff-diff-options)
-      (error "Option `-c' is not allowed in `ediff-diff-options'"))
+  ;; looking for '-c', '-i', or a 'c', 'i' among clustered non-long options
+  (if (string-match "^-[ci]\\| -[ci]\\|-[^- ]+[ci]" ediff-diff-options)
+      (error "Options `-c' and `-i' are not allowed in `ediff-diff-options'"))
 
   ;; create, if it doesn't exist
   (or (ediff-buffer-live-p ediff-diff-buffer)
 	     (ediff-exec-process ediff-diff-program
 				 diff-buffer
 				 'synchronize
-				 ediff-diff-options file1 file2)
+				 ediff-actual-diff-options file1 file2)
 	     (message "")
 	     (ediff-with-current-buffer diff-buffer
 	       (buffer-size))))))
   (let (diff3-job diff-program diff-options ok-regexp diff-list)
     (setq diff3-job ediff-3way-job
 	  diff-program (if diff3-job ediff-diff3-program ediff-diff-program)
-	  diff-options (if diff3-job ediff-diff3-options ediff-diff-options)
+	  diff-options (if diff3-job
+			   ediff-actual-diff3-options
+			 ediff-actual-diff-options)
 	  ok-regexp (if diff3-job
 			ediff-diff3-ok-lines-regexp
 			ediff-diff-ok-lines-regexp))
 	(B-buffer ediff-buffer-B)
 	(C-buffer ediff-buffer-C)
 	(a-prev 1) ; this is needed to set the first diff line correctly
+	(a-prev-pt nil)
 	(b-prev 1)
+	(b-prev-pt nil)
 	(c-prev 1)
+	(c-prev-pt nil)
 	diff-list shift-A shift-B
 	)
-
+    
     ;; diff list contains word numbers, unless changed later
     (setq diff-list (cons (if word-mode 'words 'points)
 			  diff-list))
 	      shift-B
 	      (ediff-overlay-start
 	       (ediff-get-value-according-to-buffer-type 'B bounds))))
-
+    
     ;; reset point in buffers A/B/C
     (ediff-with-current-buffer A-buffer
       (goto-char (if shift-A shift-A (point-min))))
 	       ;; we must disable and then restore longlines-mode
 	       (if (eq longlines-mode-val 1)
 		   (longlines-mode 0))
+	       (goto-char (or a-prev-pt shift-A (point-min)))
 	       (forward-line (- a-begin a-prev))
 	       (setq a-begin-pt (point))
 	       (forward-line (- a-end a-begin))
 	       (setq a-end-pt (point)
-		     a-prev a-end)
+		     a-prev a-end
+		     a-prev-pt a-end-pt)
 	       (if (eq longlines-mode-val 1)
 		   (longlines-mode longlines-mode-val))
 	       ))
 		    (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
 	       (if (eq longlines-mode-val 1)
 		   (longlines-mode 0))
+	       (goto-char (or b-prev-pt shift-B (point-min)))
 	       (forward-line (- b-begin b-prev))
 	       (setq b-begin-pt (point))
 	       (forward-line (- b-end b-begin))
 	       (setq b-end-pt (point)
-		     b-prev b-end)
+		     b-prev b-end
+		     b-prev-pt b-end-pt)
 	       (if (eq longlines-mode-val 1)
 		   (longlines-mode longlines-mode-val))
 	       ))
 			(if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
 		   (if (eq longlines-mode-val 1)
 		       (longlines-mode 0))
+		   (goto-char (or c-prev-pt (point-min)))
 		   (forward-line (- c-begin c-prev))
 		   (setq c-begin-pt (point))
 		   (forward-line (- c-end c-begin))
 		   (setq c-end-pt (point)
-			 c-prev c-end)
+			 c-prev c-end
+			 c-prev-pt c-end-pt)
 		   (if (eq longlines-mode-val 1)
 		       (longlines-mode longlines-mode-val))
 		 )))
 	(C-buffer ediff-buffer-C)
 	(anc-buffer ediff-ancestor-buffer)
 	(a-prev 1) ; needed to set the first diff line correctly
+	(a-prev-pt nil)
 	(b-prev 1)
+	(b-prev-pt nil)
 	(c-prev 1)
+	(c-prev-pt nil)
 	(anc-prev 1)
 	diff-list shift-A shift-B shift-C
 	)
 		     ;; we must disable and then restore longlines-mode
 		     (if (eq longlines-mode-val 1)
 			 (longlines-mode 0))
+		     (goto-char (or a-prev-pt shift-A (point-min)))
 		     (forward-line (- a-begin a-prev))
 		     (setq a-begin-pt (point))
 		     (forward-line (- a-end a-begin))
 		     (setq a-end-pt (point)
-			   a-prev a-end)
+			   a-prev a-end
+			   a-prev-pt a-end-pt)
 		     (if (eq longlines-mode-val 1)
 			 (longlines-mode longlines-mode-val))
 		     ))
 			  (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
 		     (if (eq longlines-mode-val 1)
 			 (longlines-mode 0))
+		     (goto-char (or b-prev-pt shift-B (point-min)))
 		     (forward-line (- b-begin b-prev))
 		     (setq b-begin-pt (point))
 		     (forward-line (- b-end b-begin))
 		     (setq b-end-pt (point)
-			   b-prev b-end)
+			   b-prev b-end
+			   b-prev-pt b-end-pt)
 		     (if (eq longlines-mode-val 1)
 			 (longlines-mode longlines-mode-val))
 		     ))
 			  (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
 		     (if (eq longlines-mode-val 1)
 			 (longlines-mode 0))
+		     (goto-char (or c-prev-pt shift-C (point-min)))
 		     (forward-line (- c-begin c-prev))
 		     (setq c-begin-pt (point))
 		     (forward-line (- c-end c-begin))
 		     (setq c-end-pt (point)
-			   c-prev c-end)
+			   c-prev c-end
+			   c-prev-pt c-end-pt)
 		     (if (eq longlines-mode-val 1)
 			 (longlines-mode longlines-mode-val))
 		     ))
 ;; File-C is either the third file to compare (in case of 3-way comparison)
 ;; or it is the ancestor file.
 (defun ediff-setup-diff-regions3 (file-A file-B file-C)
+  ;; looking for '-i' or a 'i' among clustered non-long options
+  (if (string-match "^-i\\| -i\\|-[^- ]+i" ediff-diff-options)
+      (error "Option `-i' is not allowed in `ediff-diff3-options'"))
+
   (or (ediff-buffer-live-p ediff-diff-buffer)
       (setq ediff-diff-buffer
 	    (get-buffer-create (ediff-unique-buffer-name "*ediff-diff" "*"))))
 
   (message "Computing differences ...")
   (ediff-exec-process ediff-diff3-program ediff-diff-buffer 'synchronize
-		      ediff-diff3-options file-A file-B file-C)
+		      ediff-actual-diff3-options file-A file-B file-C)
 
   (ediff-prepare-error-list ediff-diff3-ok-lines-regexp ediff-diff-buffer)
   ;;(message "Computing differences ... done")
       (setq file-list-list (cdr file-list-list)))
     (reverse result)))
 
+;; Ignore case handling - some ideas from drew.adams@@oracle.com
+(defun ediff-toggle-ignore-case ()
+  (interactive)
+  (ediff-barf-if-not-control-buffer)
+  (setq ediff-ignore-case (not ediff-ignore-case))
+  (cond (ediff-ignore-case
+	 (setq ediff-actual-diff-options 
+	       (concat ediff-diff-options " " ediff-ignore-case-option)
+	       ediff-actual-diff3-options
+	       (concat ediff-diff3-options " " ediff-ignore-case-option3))
+	 (message "Ignoring regions that differ only in case"))
+	(t
+	 (setq ediff-actual-diff-options ediff-diff-options
+	       ediff-actual-diff3-options ediff-diff3-options)
+	 (message "Ignoring case differences turned OFF")))
+  (cond (ediff-merge-job
+	 (message "Ignoring letter case is too dangerous in merge jobs"))
+	((and ediff-diff3-job (string= ediff-ignore-case-option3 ""))
+	 (message "Ignoring letter case is not supported by this diff3 program"))
+	((and (not ediff-3way-job) (string= ediff-ignore-case-option ""))
+	 (message "Ignoring letter case is not supported by this diff program"))
+	(t
+	 (sit-for 1)
+	 (ediff-update-diffs)))
+  )
+
+
+(provide 'ediff-diff)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; ediff-help.el --- Code related to the contents of Ediff help buffers
 
 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;;   2004, 2005 Free Software Foundation, Inc.
+;;   2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
 
 ;;; Code:
 
-(provide 'ediff-help)
 
 ;; Compiler pacifier start
 (defvar ediff-multiframe)
 p,DEL -previous diff |     | -vert/horiz split   | xy -copy buf X's region to Y
 n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
     j -jump to diff  |     @ -auto-refinement    |  * -refine current region
-   gx -goto X's point|                           |  ! -update diff regions
-  C-l -recenter      |    ## -ignore whitespace  |
+   gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions
+  C-l -recenter      |    #c -ignore case        |
   v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
   </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
     ~ -rotate buffers|     m -wide display       |
 p,DEL -previous diff |     | -vert/horiz split   |a/b -copy A/B's region to B/A
 n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
     j -jump to diff  |     @ -auto-refinement    |  * -refine current region
-   gx -goto X's point|                           |  ! -update diff regions
-  C-l -recenter      |    ## -ignore whitespace  |
+   gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions
+  C-l -recenter      |    #c -ignore case        |
   v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
   </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
     ~ -swap variants |     m -wide display       |
 p,DEL -previous diff |     | -vert/horiz split   |a/b -copy A/B's region to B/A
 n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
     j -jump to diff  |     @ -auto-refinement    |  * -refine current region
-   gx -goto X's point|     % -narrow/widen buffs |  ! -update diff regions
-  C-l -recenter      |    ## -ignore whitespace  |
+   gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions
+  C-l -recenter      |    #c -ignore case        |  % -narrow/widen buffs 
   v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
   </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
     ~ -swap variants |     m -wide display       |
 p,DEL -previous diff |     | -vert/horiz split   | xy -copy buf X's region to Y
 n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
     j -jump to diff  |                           |
-   gx -goto X's point|     % -narrow/widen buffs |  ! -recompute diffs
-  C-l -recenter      |                           |
+   gx -goto X's point|    % -narrow/widen buffs  |  ! -recompute diffs
+  C-l -recenter      |    #c -ignore case        |
   v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
   </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
     ~ -swap variants |     m -wide display       |
 	    ((string= cmd "r") (re-search-forward "^`r'"))
 	    ((string= cmd "rx") (re-search-forward "^`ra'"))
 	    ((string= cmd "##") (re-search-forward "^`##'"))
+	    ((string= cmd "#c") (re-search-forward "^`#c'"))
 	    ((string= cmd "#f/#h") (re-search-forward "^`#f'"))
 	    ((string= cmd "X") (re-search-forward "^`A'"))
 	    ((string= cmd "v/V") (re-search-forward "^`v'"))
   (customize-group "ediff"))
 
 
+(provide 'ediff-help)
+
+
 ;;; arch-tag: 05659813-7fcf-4274-964f-d2f577431a9d
 ;;; ediff-help.el ends here
 ;;; ediff-hook.el --- setup for Ediff's menus and autoloads
 
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;;   2004, 2005 Free Software Foundation, Inc.
+;;   2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
 
 (provide 'ediff-hook)
 
+
 ;;; arch-tag: 512f8656-8a4b-4789-af5d-5c6144498df3
 ;;; ediff-hook.el ends here
 ;;; ediff-init.el --- Macros, variables, and defsubsts used by 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>
 
 	     (set-buffer ,old-buffer)
 	     (set-syntax-table ,old-table)))))))
 
+
 (provide 'ediff-init)
 
 
 ;;; ediff-merg.el --- merging utilities
 
 ;; 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-merg)
 
 ;; compiler pacifier
 (defvar ediff-window-A)
 	)))
 
 
+(provide 'ediff-merg)
+
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
 ;;; ediff-mult.el --- support for multi-file/multi-buffer processing in Ediff
 
 ;; Copyright (C) 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-mult)
 
 (defgroup ediff-mult nil
   "Multi-file and multi-buffer processing in Ediff."
 ;; end pacifier
 
 (require 'ediff-init)
-(require 'ediff-util)
 
 ;; meta-buffer
 (ediff-defvar-local ediff-meta-buffer nil "")
 
 (defcustom ediff-default-filtering-regexp nil
   "The default regular expression used as a filename filter in multifile comparisons.
-Should be a sexp. For instance (car ediff-filtering-regexp-history) or nil."
+Should be a sexp.  For instance (car ediff-filtering-regexp-history) or nil."
   :type 'sexp
   :group 'ediff-mult)
 
 
 (defcustom ediff-before-session-group-setup-hooks nil
   "*Hooks to run before Ediff arranges the window for group-level operations.
-It is used by commands such as ediff-directories.
+It is used by commands such as `ediff-directories'.
 This hook can be used to save the previous window config, which can be restored
-on ediff-quit, ediff-suspend, or ediff-quit-session-group-hook."
+on `ediff-quit', `ediff-suspend', or `ediff-quit-session-group-hook'."
   :type 'hook
   :group 'ediff-hook)
 (defcustom ediff-after-session-group-setup-hook nil
   :type 'hook
   :group 'ediff-mult)
 (defcustom ediff-meta-buffer-keymap-setup-hook nil
-  "*Hooks run just after setting up the ediff-meta-buffer-map.
+  "*Hooks run just after setting up the `ediff-meta-buffer-map'.
 This keymap controls key bindings in the meta buffer and is a local variable.
 This means that you can set different bindings for different kinds of meta
 buffers."
 	   (file-directory-p (ediff-get-session-objC-name session-info)) t)))
 
 ;; set up the keymap in the meta buffer
-(defun ediff-setup-meta-map()
+(defun ediff-setup-meta-map ()
   (setq ediff-meta-buffer-map (make-sparse-keymap))
   (suppress-keymap ediff-meta-buffer-map)
   (define-key ediff-meta-buffer-map "q" 'ediff-quit-meta-buffer)
       (ediff-overlay-put overl 'highlight t))
     (ediff-overlay-put overl 'ediff-meta-info prop)
     (ediff-overlay-put overl 'invisible hidden)
+    (ediff-overlay-put overl 'follow-link t)
     (if (numberp session-number)
 	(ediff-overlay-put overl 'ediff-meta-session-number session-number))))
 
   "Run through the session list and mark identical files.
 This is used only for sessions that involve 2 or 3 files at the same time.
 ACTION is an optional argument that can be ?h, ?m, ?=, to mark for hiding, mark
-for operation, or simply indicate which are equal files. If it is nil, then
-last-command-char is used to decide which action to take."
+for operation, or simply indicate which are equal files.  If it is nil, then
+`last-command-char' is used to decide which action to take."
   (interactive)
   (if (null action)
       (setq action last-command-char))
     ))
 
 
+(provide 'ediff-mult)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; ediff-ptch.el --- Ediff's  patch support
 
 ;; Copyright (C) 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-ptch)
 
 (defgroup ediff-ptch nil
   "Ediff patch support."
 
 
 
+(provide 'ediff-ptch)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; ediff-tbar.el --- A toolbar for Ediff control buffer
 
-;; Copyright (C) 1996, 97, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 97, 2002, 2003, 2004, 2005,
+;; 2006 Free Software Foundation, Inc.
 
 ;; Author: Marc Paquette <marcpa@cam.org>
 
 
 ;;; Code:
 	 
-(provide 'ediff-tbar)
 
 ;; compiler pacifier
 (eval-when-compile
 	)))
 
 
+(provide 'ediff-tbar)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; 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)))
 	)))
 
 
-(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)
 	    (>= (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
 
 (run-hooks 'ediff-load-hook)
 
+(provide 'ediff-util)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; ediff-vers.el --- version control interface to Ediff
 
 ;; Copyright (C) 1995, 1996, 1997, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;;   2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
 
 (provide 'ediff-vers)
 
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
 ;;; ediff-wind.el --- window manipulation utilities
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003,
-;;   2004, 2005 Free Software Foundation, Inc.
+;;   2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
 
 ;;; Code:
 
-(provide 'ediff-wind)
 
 ;; Compiler pacifier
 (defvar icon-title-format)
 			     ediff-wide-display-p)))))))
 
 
+(provide 'ediff-wind)
+
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
 ;;; ediff.el --- a comprehensive visual interface to diff & patch
 
 ;; 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>
 ;; Created: February 2, 1994
 ;; Keywords: comparing, merging, patching, tools, unix
 
-(defconst ediff-version "2.80.1" "The current version of Ediff")
-(defconst ediff-date "November 25, 2005" "Date of last update")
+(defconst ediff-version "2.81" "The current version of Ediff")
+(defconst ediff-date "February 18, 2006" "Date of last update")
 
 
 ;; This file is part of GNU Emacs.
 
 ;;; Code:
 
-(provide 'ediff)
 
 ;; Compiler pacifier
 (defvar cvs-cookie-handle)
 	 (load "pcl-cvs" 'noerror)))
 (eval-when-compile
   (let ((load-path (cons (expand-file-name ".") load-path)))
+    (provide 'ediff) ; to break recursive load cycle
     (or (featurep 'ediff-init)
 	(load "ediff-init.el" nil nil 'nosuffix))
     (or (featurep 'ediff-mult)
    patch-buf
    (read-buffer
     "Which buffer to patch? "
-    (current-buffer))))
+    (ediff-other-buffer patch-buf))))
 
 
 ;;;###autoload
 
 (run-hooks 'ediff-load-hook)
 
+(provide 'ediff)
+
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
 and patch utilities.
 
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
 one of them by typing the region number and then `j'.  Typing @kbd{##}
 again puts Ediff back in the original state.
 
+@item #c
+@kindex #c
+@vindex ediff-ignore-case-option
+@vindex ediff-ignore-case-option3
+@vindex ediff-ignore-case
+Toggle case sensitivity in the diff program. All diffs are recomputed.
+Case sensitivity is controlled by the variables
+@code{ediff-ignore-case-option}, @code{ediff-ignore-case-option3},
+and @code{ediff-ignore-case}, which are explained elsewhere.
+
 @item #h
 @itemx #f
 @kindex #f
 differences of all intermediate regions.  This delay does not indicate any
 problem.
 
+@vindex ediff-ignore-case-option
+@vindex ediff-ignore-case-option3
+@vindex ediff-ignore-case
+Finally, Ediff can be told to ignore the case of the letters. This behavior
+can be toggled with @kbd{#c} and it is controlled with three variables:
+Toggle case sensitivity in the diff program. All diffs are recomputed.
+Case sensitivity is controlled by the variables
+@code{ediff-ignore-case-option}, @code{ediff-ignore-case-option3}, and
+@code{ediff-ignore-case}.
+
+The variable @code{ediff-ignore-case-option} specifies the option to pass
+to the diff program for comparing two files or buffers. For GNU
+@code{diff}, this option is @code{"-i"}. The variable
+@code{ediff-ignore-case-option3} specifies the option to pass to the
+@code{diff3} program in order to make it case-insensitive. GNU @code{diff3}
+does not have such an option, so when merging or comparing three files with
+this program, ignoring the letter case is not supported.
+
+The variable @code{ediff-ignore-case} controls whether Ediff starts out by
+ignoring letter case or not. It can be set in @file{.emacs} using
+@code{setq-default}.
+
 @node Highlighting Difference Regions, Narrowing, Selective Browsing, Customization
 @section Highlighting Difference Regions
 
 
 @example
 Adrian Aichner (aichner@@ecf.teradyne.com),
+Drew Adams (drew.adams@@oracle.com),
 Steve Baur (steve@@xemacs.org),
 Neal Becker (neal@@ctd.comsat.com),
 E.@: Jay Berkenbilt (ejb@@ql.org),