]> git.eshelyaron.com Git - emacs.git/commitdiff
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
authorMichael Kifer <kifer@cs.stonybrook.edu>
Sun, 19 Feb 2006 03:16:45 +0000 (03:16 +0000)
committerMichael Kifer <kifer@cs.stonybrook.edu>
Sun, 19 Feb 2006 03:16:45 +0000 (03:16 +0000)
* 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.

18 files changed:
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

index 42d6ab400c1db6287e045468f9faa9997a726323..166cd382bb0d253f01e0ec561f4c33581adde573 100644 (file)
@@ -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
index 67da6eae25d148eb740df2e7c6b6052696f0fad0..62a6386584e2ef20b96adf36b4d7ba790da80c90 100644 (file)
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-diff)
 
 ;; compiler pacifier
 (defvar ediff-default-variant)
@@ -129,13 +128,33 @@ are `-I REGEXP', to ignore changes whose lines match the REGEXP."
 
 (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 @@ 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'.
@@ -182,7 +205,7 @@ Use `setq-default' if setting it in .emacs")
 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 @@ one optional arguments, diff-number to refine.")
 ;; 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 @@ one optional arguments, diff-number to refine.")
             (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 @@ one optional arguments, diff-number to refine.")
   (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 @@ one optional arguments, diff-number to refine.")
        (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 @@ one optional arguments, diff-number to refine.")
              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 @@ one optional arguments, diff-number to refine.")
               ;; 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 @@ one optional arguments, diff-number to refine.")
                    (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 @@ one optional arguments, diff-number to refine.")
                        (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 @@ delimiter regions"))
        (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 @@ delimiter regions"))
                     ;; 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 @@ delimiter regions"))
                          (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 @@ delimiter regions"))
                          (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 @@ delimiter regions"))
 ;; 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 @@ affects only files whose names match the expression."
       (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)
index cc266e3c8a3eba48fb710d3227adfc92b742eeb0..d5f505c7de31b25594bdbd4f012c96a630cf5c01 100644 (file)
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-help)
 
 ;; Compiler pacifier start
 (defvar ediff-multiframe)
@@ -61,8 +60,8 @@ For help on a specific command:  Click Button 2 over it; or
 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 @@ Normally, not a user option.  See `ediff-help-message' for details.")
 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 @@ Normally, not a user option.  See `ediff-help-message' for details.")
 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 @@ Normally, not a user option.  See `ediff-help-message' for details.")
 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 @@ the value of this variable and the variables `ediff-help-message-*' in
            ((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 @@ the value of this variable and the variables `ediff-help-message-*' in
   (customize-group "ediff"))
 
 
+(provide 'ediff-help)
+
+
 ;;; arch-tag: 05659813-7fcf-4274-964f-d2f577431a9d
 ;;; ediff-help.el ends here
index 1b86e2f8f62502d7b4536532bae967daa62d1eb7..fcf261efd06fbed567626a2a50e3ff844909868e 100644 (file)
 
 (provide 'ediff-hook)
 
+
 ;;; arch-tag: 512f8656-8a4b-4789-af5d-5c6144498df3
 ;;; ediff-hook.el ends here
index 4897ffd2e59c2ffd38ff9529989c47db34b13f21..2fc0ceefe4dfdde1c268127ce9a62f2279d47a65 100644 (file)
@@ -1867,6 +1867,7 @@ Unless optional argument INPLACE is non-nil, return a new string."
             (set-buffer ,old-buffer)
             (set-syntax-table ,old-table)))))))
 
+
 (provide 'ediff-init)
 
 
index 7f0eea2cf091a7d59a569731dc52bd389b177f3a..92f462c0181928c7b2d91a7601831d17d768a11b 100644 (file)
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-merg)
 
 ;; compiler pacifier
 (defvar ediff-window-A)
@@ -390,6 +389,9 @@ Combining is done according to the specifications in variable
        )))
 
 
+(provide 'ediff-merg)
+
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
index c24e32a2124693708cfff8d83b120654f06d423c..0bbd3298c7a0538a33f67473fdc8c5112eaaf3c0 100644 (file)
 
 ;;; 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 "")
@@ -1473,6 +1471,7 @@ Useful commands:
       (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 @@ for operation, or simply indicate which are equal files.  If it is nil, then
     ))
 
 
+(provide 'ediff-mult)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
index 9c5c75d847c4db2bb2ad357487a7c308bd557725..b911c33f0fb0ac82b9ffc6a66b909acc5c7c629e 100644 (file)
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-ptch)
 
 (defgroup ediff-ptch nil
   "Ediff patch support."
@@ -844,6 +843,8 @@ you can still examine the changes via M-x ediff-files"
 
 
 
+(provide 'ediff-ptch)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
index feb7b69d7b60f174a3804ed3b65531fad84f5834..dff3c6bee6161e3c82cf00b3d7306b8ad1bdbcbf 100644 (file)
@@ -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 @@ to invocation.")
   (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 @@ of the current buffer."
 ;;       ))
 
 
-(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 @@ of the current buffer."
             (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 @@ Hit \\[ediff-recenter] to reset the windows afterward."
        )))
 
 
-(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 @@ Hit \\[ediff-recenter] to reset the windows afterward."
   )
 
 
-(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 @@ Hit \\[ediff-recenter] to reset the windows afterward."
   )
 
 ;; 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 @@ Ediff Control Panel to restore highlighting."
            (>= (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 Control Panel to restore highlighting."
        (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 @@ Mail anyway? (y or n) ")
 
 (run-hooks 'ediff-load-hook)
 
+(provide 'ediff-util)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
index 4c9dc4dd9c88ca5a2897ead84b45612577461e57..3e8b1c375723a2ba91d91e9aedc502ac20969840 100644 (file)
 
 (provide 'ediff-vers)
 
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
index 648a80b6156d38c6a1d6241b2816fe5e9271d5ca..28369f9f6bde36710f3dc2459ff59bd19151767c 100644 (file)
@@ -26,7 +26,6 @@
 
 ;;; Code:
 
-(provide 'ediff-wind)
 
 ;; Compiler pacifier
 (defvar icon-title-format)
@@ -1314,6 +1313,9 @@ It assumes that it is called from within the control buffer."
                             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)
index abb0f22b0472deccb8ffbc2e739b1d5e09717140..bb6cfc6b72eb4d31c8f9b3d304ba65d2d3b32512 100644 (file)
@@ -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.
 
 ;;; 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)
@@ -1374,7 +1374,7 @@ patch. If not given, the user is prompted according to the prefix argument."
    patch-buf
    (read-buffer
     "Which buffer to patch? "
-    (current-buffer))))
+    (ediff-other-buffer patch-buf))))
 
 
 ;;;###autoload
@@ -1533,6 +1533,9 @@ With optional NODE, goes to that node."
 
 (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)
index db82952a6ef5b1cac96012db097168d27d17a5bf..645f4f26eaf180bf98cf0b75b9ff560f20ac0187 100644 (file)
            (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)
        (indent-to-left-margin))
     (viper-add-newline-at-eob-if-necessary)
     (viper-adjust-undo)
-    (viper-change-state 'vi-state)
 
-    (viper-restore-cursor-color 'after-insert-mode)
+    (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)
 
     ;; Protect against user errors in hooks
     (condition-case conds
   (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 @@ Vi's prefix argument will be used.  Otherwise, the prefix argument passed to
                 ;; 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 @@ Vi's prefix argument will be used.  Otherwise, the prefix argument passed to
               ;; 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 @@ Vi's prefix argument will be used.  Otherwise, the prefix argument passed to
                   (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 @@ To turn this feature off, set this variable to nil."
 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)))))
index 59a78e46deefc69c964ddbcaaf339829b6acbfea..661fc6ede7f47a2d1edf5bd572780ca71eb37d9c 100644 (file)
@@ -434,6 +434,13 @@ delete the text being replaced, as in standard Vi."
 (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)
index 8f79c0dab4a9ba296a8e95eea1d043969f725fdb..c7fe792b5f25d8fa100004f6e189054008710314 100644 (file)
             (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)))
          ))))
 
     (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
     (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)))
        )))
 
 \f
index 223cff3dd9953d3ad6a354a1ddfe716e3a37970e..fc55d291550df837cd801f4bb5846b8456718b9b 100644 (file)
@@ -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.
index 67e822049cb39101710afc1ee69f0fdc107d88b9..01e79c821d0814ef5c70903348793a69ac30cb1c 100644 (file)
@@ -686,6 +686,16 @@ Even though such regions will be skipped over, you can still jump to any
 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 @@ Ediff may take a long time to skip over them because it has to compute fine
 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 @@ Here is a hopefully full list of contributors:
 
 @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),
index 4ad437a762d66dd1ff6cc70592c8f8eb8c3023f9..46d62670345eb2aa4de1ca7bcd5e85c911ffd4bd 100644 (file)
@@ -1870,6 +1870,10 @@ application.
 @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}.