changeset 68997:6169b51037af

2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu> * viper-cmd.el (viper-insert-state-post-command-sentinel, viper-change-state-to-vi, viper-change-state-to-emacs): made aware of cursor coloring in the emacs state. (viper-special-read-and-insert-char): use read-char-exclusive. (viper-minibuffer-trim-tail): workaround for fields in minibuffer. * viper-init.el (viper-emacs-state-cursor-color): new variable. * viper-util.el (viper-save-cursor-color, viper-get-saved-cursor-color-in-replace-mode, viper-get-saved-cursor-color-in-insert-mode, viper-restore-cursor-color): make aware of the cursor color in emacs state. (viper-get-saved-cursor-color-in-emacs-mode): new function. * 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.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Sun, 19 Feb 2006 03:16:45 +0000
parents ef46b6afadc4
children 23217e6a7030
files lisp/ChangeLog lisp/ediff-diff.el lisp/ediff-help.el lisp/ediff-hook.el lisp/ediff-init.el lisp/ediff-merg.el lisp/ediff-mult.el lisp/ediff-ptch.el lisp/ediff-util.el lisp/ediff-vers.el lisp/ediff-wind.el lisp/ediff.el lisp/emulation/viper-cmd.el lisp/emulation/viper-init.el lisp/emulation/viper-util.el lisp/emulation/viper.el man/ediff.texi man/viper.texi
diffstat 18 files changed, 287 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ChangeLog	Sun Feb 19 03:16:45 2006 +0000
@@ -1,3 +1,53 @@
+2006-02-19  Michael Kifer  <kifer@cs.stonybrook.edu>
+	
+	* viper-cmd.el (viper-insert-state-post-command-sentinel,
+	viper-change-state-to-vi, viper-change-state-to-emacs): 
+	made aware of cursor coloring in the emacs state.
+	(viper-special-read-and-insert-char): use read-char-exclusive.
+	(viper-minibuffer-trim-tail): workaround for fields in minibuffer.
+	
+	* viper-init.el (viper-emacs-state-cursor-color): new variable.
+	
+	* viper-util.el (viper-save-cursor-color,
+	viper-get-saved-cursor-color-in-replace-mode,
+	viper-get-saved-cursor-color-in-insert-mode,
+	viper-restore-cursor-color): make aware of the cursor color in emacs
+	state.
+	(viper-get-saved-cursor-color-in-emacs-mode): new function.
+	
+	* 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.
+	
 2006-02-19  Juanma Barranquero  <lekktu@gmail.com>
 
 	* help-fns.el (help-do-arg-highlight): Recognize also ARG- followed by
--- a/lisp/ediff-diff.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff-diff.el	Sun Feb 19 03:16:45 2006 +0000
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-diff)
 
 ;; compiler pacifier
 (defvar ediff-default-variant)
@@ -129,13 +128,33 @@
 
 (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."
@@ -155,6 +174,10 @@
   :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'.
@@ -182,7 +205,7 @@
 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
@@ -227,9 +250,9 @@
 ;; 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)
@@ -266,7 +289,7 @@
 	     (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))))))
@@ -284,7 +307,9 @@
   (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))
@@ -366,11 +391,14 @@
 	(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))
@@ -382,7 +410,7 @@
 	      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))))
@@ -466,11 +494,13 @@
 	       ;; 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))
 	       ))
@@ -479,11 +509,13 @@
 		    (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))
 	       ))
@@ -493,11 +525,13 @@
 			(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))
 		 )))
@@ -987,8 +1021,11 @@
 	(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
 	)
@@ -1089,11 +1126,13 @@
 		     ;; 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))
 		     ))
@@ -1102,11 +1141,13 @@
 			  (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))
 		     ))
@@ -1115,11 +1156,13 @@
 			  (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))
 		     ))
@@ -1171,13 +1214,17 @@
 ;; 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")
@@ -1471,6 +1518,35 @@
       (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)
--- a/lisp/ediff-help.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff-help.el	Sun Feb 19 03:16:45 2006 +0000
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-help)
 
 ;; Compiler pacifier start
 (defvar ediff-multiframe)
@@ -61,8 +60,8 @@
 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       |
@@ -75,8 +74,8 @@
 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       |
@@ -89,8 +88,8 @@
 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       |
@@ -103,8 +102,8 @@
 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       |
@@ -228,6 +227,7 @@
 	    ((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'"))
@@ -325,5 +325,8 @@
   (customize-group "ediff"))
 
 
+(provide 'ediff-help)
+
+
 ;;; arch-tag: 05659813-7fcf-4274-964f-d2f577431a9d
 ;;; ediff-help.el ends here
--- a/lisp/ediff-hook.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff-hook.el	Sun Feb 19 03:16:45 2006 +0000
@@ -371,5 +371,6 @@
 
 (provide 'ediff-hook)
 
+
 ;;; arch-tag: 512f8656-8a4b-4789-af5d-5c6144498df3
 ;;; ediff-hook.el ends here
--- a/lisp/ediff-init.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff-init.el	Sun Feb 19 03:16:45 2006 +0000
@@ -1867,6 +1867,7 @@
 	     (set-buffer ,old-buffer)
 	     (set-syntax-table ,old-table)))))))
 
+
 (provide 'ediff-init)
 
 
--- a/lisp/ediff-merg.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff-merg.el	Sun Feb 19 03:16:45 2006 +0000
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-merg)
 
 ;; compiler pacifier
 (defvar ediff-window-A)
@@ -390,6 +389,9 @@
 	)))
 
 
+(provide 'ediff-merg)
+
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
--- a/lisp/ediff-mult.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff-mult.el	Sun Feb 19 03:16:45 2006 +0000
@@ -104,7 +104,6 @@
 
 ;;; Code:
 
-(provide 'ediff-mult)
 
 (defgroup ediff-mult nil
   "Multi-file and multi-buffer processing in Ediff."
@@ -123,7 +122,6 @@
 ;; end pacifier
 
 (require 'ediff-init)
-(require 'ediff-util)
 
 ;; meta-buffer
 (ediff-defvar-local ediff-meta-buffer nil "")
@@ -1473,6 +1471,7 @@
       (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))))
 
@@ -2384,6 +2383,8 @@
     ))
 
 
+(provide 'ediff-mult)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
--- a/lisp/ediff-ptch.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff-ptch.el	Sun Feb 19 03:16:45 2006 +0000
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-ptch)
 
 (defgroup ediff-ptch nil
   "Ediff patch support."
@@ -844,6 +843,8 @@
 
 
 
+(provide 'ediff-ptch)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
--- a/lisp/ediff-util.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff-util.el	Sun Feb 19 03:16:45 2006 +0000
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-util)
 
 ;; Compiler pacifier
 (defvar ediff-patch-diagnostics)
@@ -49,6 +48,7 @@
 
 (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)
@@ -234,6 +234,7 @@
   (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)
@@ -1133,7 +1134,7 @@
 ;;       ))
 
 
-(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)
@@ -1143,7 +1144,7 @@
 	     (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)))
@@ -3079,7 +3080,7 @@
 	)))
 
 
-(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)
@@ -3088,7 +3089,7 @@
   )
 
 
-(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)
@@ -3097,7 +3098,7 @@
   )
 
 ;; 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)
@@ -3686,7 +3687,7 @@
 	    (>= (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
@@ -3945,6 +3946,7 @@
 	(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
@@ -4300,6 +4302,8 @@
 
 (run-hooks 'ediff-load-hook)
 
+(provide 'ediff-util)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
--- a/lisp/ediff-vers.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff-vers.el	Sun Feb 19 03:16:45 2006 +0000
@@ -311,6 +311,7 @@
 
 (provide 'ediff-vers)
 
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
--- a/lisp/ediff-wind.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff-wind.el	Sun Feb 19 03:16:45 2006 +0000
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-wind)
 
 ;; Compiler pacifier
 (defvar icon-title-format)
@@ -1314,6 +1313,9 @@
 			     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)
--- a/lisp/ediff.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/ediff.el	Sun Feb 19 03:16:45 2006 +0000
@@ -7,8 +7,8 @@
 ;; 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.
@@ -107,7 +107,6 @@
 
 ;;; Code:
 
-(provide 'ediff)
 
 ;; Compiler pacifier
 (defvar cvs-cookie-handle)
@@ -121,6 +120,7 @@
 	 (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)
@@ -1374,7 +1374,7 @@
    patch-buf
    (read-buffer
     "Which buffer to patch? "
-    (current-buffer))))
+    (ediff-other-buffer patch-buf))))
 
 
 ;;;###autoload
@@ -1533,6 +1533,9 @@
 
 (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)
--- a/lisp/emulation/viper-cmd.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/emulation/viper-cmd.el	Sun Feb 19 03:16:45 2006 +0000
@@ -196,6 +196,15 @@
 	    (viper-save-cursor-color 'before-insert-mode))
 	;; set insert mode cursor color
 	(viper-change-cursor-color viper-insert-state-cursor-color)))
+  (if (eq viper-current-state 'emacs-state)
+      (let ((has-saved-cursor-color-in-emacs-mode
+	     (stringp (viper-get-saved-cursor-color-in-emacs-mode))))
+	(or has-saved-cursor-color-in-emacs-mode
+	    (string= (viper-get-cursor-color) viper-emacs-state-cursor-color)
+	    ;; save current color, if not already saved
+	    (viper-save-cursor-color 'before-emacs-mode))
+	;; set emacs mode cursor color
+	(viper-change-cursor-color viper-emacs-state-cursor-color)))
 
   (if (and (memq this-command '(dabbrev-expand hippie-expand))
 	   (integerp viper-pre-command-point)
@@ -643,10 +652,13 @@
 	(indent-to-left-margin))
     (viper-add-newline-at-eob-if-necessary)
     (viper-adjust-undo)
+
+    (if (eq viper-current-state 'emacs-state)
+	(viper-restore-cursor-color 'after-emacs-mode)
+      (viper-restore-cursor-color 'after-insert-mode))
+
     (viper-change-state 'vi-state)
 
-    (viper-restore-cursor-color 'after-insert-mode)
-
     ;; Protect against user errors in hooks
     (condition-case conds
 	(run-hooks 'viper-vi-state-hook)
@@ -709,9 +721,17 @@
   (or (viper-overlay-p viper-replace-overlay)
       (viper-set-replace-overlay (point-min) (point-min)))
   (viper-hide-replace-overlay)
+
+  (let ((has-saved-cursor-color-in-emacs-mode
+	 (stringp (viper-get-saved-cursor-color-in-emacs-mode))))
+    (or has-saved-cursor-color-in-emacs-mode
+	(string= (viper-get-cursor-color) viper-emacs-state-cursor-color)
+	(viper-save-cursor-color 'before-emacs-mode))
+    (viper-change-cursor-color viper-emacs-state-cursor-color))
+
   (viper-change-state 'emacs-state)
 
-  ;; Protect agains user errors in hooks
+  ;; Protect against user errors in hooks
   (condition-case conds
       (run-hooks 'viper-emacs-state-hook)
     (error
@@ -820,12 +840,12 @@
 		 ;; The next cmd  and viper-set-unread-command-events
 		 ;; are intended to prevent the input method
 		 ;; from swallowing ^M, ^Q and other special characters
-		 (setq ch (read-char))
+		 (setq ch (read-char-exclusive))
 		 ;; replace ^M with the newline
 		 (if (eq ch ?\C-m) (setq ch ?\n))
 		 ;; Make sure ^V and ^Q work as quotation chars
 		 (if (memq ch '(?\C-v ?\C-q))
-		     (setq ch (read-char)))
+		     (setq ch (read-char-exclusive)))
 		 (viper-set-unread-command-events ch)
 		 (quail-input-method nil)
 
@@ -842,12 +862,12 @@
 	       ;; same as above but for XEmacs, which doesn't have
 	       ;; quail-input-method
 	       (let (unread-command-events)
-		 (setq ch (read-char))
+		 (setq ch (read-char-exclusive))
 		 ;; replace ^M with the newline
 		 (if (eq ch ?\C-m) (setq ch ?\n))
 		 ;; Make sure ^V and ^Q work as quotation chars
 		 (if (memq ch '(?\C-v ?\C-q))
-		     (setq ch (read-char)))
+		     (setq ch (read-char-exclusive)))
 		 (viper-set-unread-command-events ch)
 		 (quail-start-translation nil)
 
@@ -867,12 +887,12 @@
 		   (setq ch (aref (read-key-sequence nil) 0)))
 	       (insert ch))
 	      (t
-	       (setq ch (read-char))
+	       (setq ch (read-char-exclusive))
 	       ;; replace ^M with the newline
 	       (if (eq ch ?\C-m) (setq ch ?\n))
 	       ;; Make sure ^V and ^Q work as quotation chars
 	       (if (memq ch '(?\C-v ?\C-q))
-		   (setq ch (read-char)))
+		   (setq ch (read-char-exclusive)))
 	       (insert ch))
 	      )
 	(setq last-command-event
@@ -2131,7 +2151,7 @@
 Remove this function from `viper-minibuffer-exit-hook', if this causes
 problems."
   (if (viper-is-in-minibuffer)
-      (progn
+      (let ((inhibit-field-text-motion t))
 	(goto-char (viper-minibuffer-real-start))
 	(end-of-line)
 	(delete-region (point) (point-max)))))
--- a/lisp/emulation/viper-init.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/emulation/viper-init.el	Sun Feb 19 03:16:45 2006 +0000
@@ -434,6 +434,13 @@
 (if (fboundp 'make-variable-frame-local)
     (make-variable-frame-local 'viper-insert-state-cursor-color))
 
+(defcustom viper-emacs-state-cursor-color "Magenta"
+  "Cursor color when Viper is in emacs state."
+  :type 'string
+  :group 'viper)
+(if (fboundp 'make-variable-frame-local)
+    (make-variable-frame-local 'viper-emacs-state-cursor-color))
+
 ;; internal var, used to remember the default cursor color of emacs frames
 (defvar viper-vi-state-cursor-color nil)
 (if (fboundp 'make-variable-frame-local)
--- a/lisp/emulation/viper-util.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/emulation/viper-util.el	Sun Feb 19 03:16:45 2006 +0000
@@ -175,9 +175,12 @@
 	     (selected-frame)
 	     (list
 	      (cons
-	       (if (eq before-which-mode 'before-replace-mode)
-		   'viper-saved-cursor-color-in-replace-mode
-		 'viper-saved-cursor-color-in-insert-mode)
+	       (cond ((eq before-which-mode 'before-replace-mode)
+		      'viper-saved-cursor-color-in-replace-mode)
+		     ((eq before-which-mode 'before-emacs-mode)
+		      'viper-saved-cursor-color-in-emacs-mode)
+		     (t
+		      'viper-saved-cursor-color-in-insert-mode))
 	       color)))
 	  ))))
 
@@ -188,7 +191,9 @@
     (if viper-emacs-p 'frame-parameter 'frame-property)
     (selected-frame)
     'viper-saved-cursor-color-in-replace-mode)
-   viper-vi-state-cursor-color))
+   (if (eq viper-current-state 'emacs-mode)
+       viper-emacs-state-cursor-color
+     viper-vi-state-cursor-color)))
 
 (defsubst viper-get-saved-cursor-color-in-insert-mode ()
   (or
@@ -196,15 +201,27 @@
     (if viper-emacs-p 'frame-parameter 'frame-property)
     (selected-frame)
     'viper-saved-cursor-color-in-insert-mode)
+   (if (eq viper-current-state 'emacs-mode)
+       viper-emacs-state-cursor-color
+     viper-vi-state-cursor-color)))
+
+(defsubst viper-get-saved-cursor-color-in-emacs-mode ()
+  (or
+   (funcall
+    (if viper-emacs-p 'frame-parameter 'frame-property)
+    (selected-frame)
+    'viper-saved-cursor-color-in-emacs-mode)
    viper-vi-state-cursor-color))
 
 ;; restore cursor color from replace overlay
 (defun viper-restore-cursor-color(after-which-mode)
   (if (viper-overlay-p viper-replace-overlay)
       (viper-change-cursor-color
-       (if (eq after-which-mode 'after-replace-mode)
-	   (viper-get-saved-cursor-color-in-replace-mode)
-	 (viper-get-saved-cursor-color-in-insert-mode))
+       (cond ((eq after-which-mode 'after-replace-mode)
+	      (viper-get-saved-cursor-color-in-replace-mode))
+	     ((eq after-which-mode 'after-emacs-mode)
+	      (viper-get-saved-cursor-color-in-emacs-mode))
+	     (t (viper-get-saved-cursor-color-in-insert-mode)))
        )))
 
 
--- a/lisp/emulation/viper.el	Sat Feb 18 23:38:39 2006 +0000
+++ b/lisp/emulation/viper.el	Sun Feb 19 03:16:45 2006 +0000
@@ -9,7 +9,7 @@
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Keywords: emulations
 
-(defconst viper-version "3.11.5 of November 25, 2005"
+(defconst viper-version "3.12 of February 18, 2006"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.
--- a/man/ediff.texi	Sat Feb 18 23:38:39 2006 +0000
+++ b/man/ediff.texi	Sun Feb 19 03:16:45 2006 +0000
@@ -686,6 +686,16 @@
 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
@@ -1584,6 +1594,28 @@
 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
 
@@ -2388,6 +2420,7 @@
 
 @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),
--- a/man/viper.texi	Sat Feb 18 23:38:39 2006 +0000
+++ b/man/viper.texi	Sun Feb 19 03:16:45 2006 +0000
@@ -1870,6 +1870,10 @@
 @vindex @code{viper-insert-state-cursor-color}
 If set to a valid color, this will be the cursor color when Viper is in
 insert state.
+@item viper-emacs-state-cursor-color nil
+@vindex @code{viper-emacs-state-cursor-color}
+If set to a valid color, this will be the cursor color when Viper is in
+emacs state.
 @item viper-replace-region-end-delimiter "$"
 A string used to mark the end of replacement regions.  It is used only on
 TTYs or if @code{viper-use-replace-region-delimiters} is non-@code{nil}.