comparison lisp/ediff-util.el @ 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 3bd95f4f2941
children 54ea774c3eed d1c5430c5bff
comparison
equal deleted inserted replaced
68996:ef46b6afadc4 68997:6169b51037af
24 24
25 ;;; Commentary: 25 ;;; Commentary:
26 26
27 ;;; Code: 27 ;;; Code:
28 28
29 (provide 'ediff-util)
30 29
31 ;; Compiler pacifier 30 ;; Compiler pacifier
32 (defvar ediff-patch-diagnostics) 31 (defvar ediff-patch-diagnostics)
33 (defvar ediff-patchbufer) 32 (defvar ediff-patchbufer)
34 (defvar ediff-use-toolbar-p) 33 (defvar ediff-use-toolbar-p)
47 (eval-when-compile 46 (eval-when-compile
48 (load "reporter" 'noerror))) 47 (load "reporter" 'noerror)))
49 48
50 (eval-when-compile 49 (eval-when-compile
51 (let ((load-path (cons (expand-file-name ".") load-path))) 50 (let ((load-path (cons (expand-file-name ".") load-path)))
51 (provide 'ediff-util) ; to break recursive load cycle
52 (or (featurep 'ediff-init) 52 (or (featurep 'ediff-init)
53 (load "ediff-init.el" nil nil 'nosuffix)) 53 (load "ediff-init.el" nil nil 'nosuffix))
54 (or (featurep 'ediff-help) 54 (or (featurep 'ediff-help)
55 (load "ediff-help.el" nil nil 'nosuffix)) 55 (load "ediff-help.el" nil nil 'nosuffix))
56 (or (featurep 'ediff-mult) 56 (or (featurep 'ediff-mult)
232 ) ; cond 232 ) ; cond
233 (define-key ediff-mode-map "G" 'ediff-submit-report) 233 (define-key ediff-mode-map "G" 'ediff-submit-report)
234 (define-key ediff-mode-map "#" nil) 234 (define-key ediff-mode-map "#" nil)
235 (define-key ediff-mode-map "#h" 'ediff-toggle-regexp-match) 235 (define-key ediff-mode-map "#h" 'ediff-toggle-regexp-match)
236 (define-key ediff-mode-map "#f" 'ediff-toggle-regexp-match) 236 (define-key ediff-mode-map "#f" 'ediff-toggle-regexp-match)
237 (define-key ediff-mode-map "#c" 'ediff-toggle-ignore-case)
237 (or ediff-word-mode 238 (or ediff-word-mode
238 (define-key ediff-mode-map "##" 'ediff-toggle-skip-similar)) 239 (define-key ediff-mode-map "##" 'ediff-toggle-skip-similar))
239 (define-key ediff-mode-map "o" nil) 240 (define-key ediff-mode-map "o" nil)
240 (define-key ediff-mode-map "A" 'ediff-toggle-read-only) 241 (define-key ediff-mode-map "A" 'ediff-toggle-read-only)
241 (define-key ediff-mode-map "B" 'ediff-toggle-read-only) 242 (define-key ediff-mode-map "B" 'ediff-toggle-read-only)
1131 ;; ;; check if a version is in RCS/ directory 1132 ;; ;; check if a version is in RCS/ directory
1132 ;; (file-exists-p full-rcs-trial))) 1133 ;; (file-exists-p full-rcs-trial)))
1133 ;; )) 1134 ;; ))
1134 1135
1135 1136
1136 (defsubst ediff-file-checked-out-p (file) 1137 (defun ediff-file-checked-out-p (file)
1137 (or (not (featurep 'vc-hooks)) 1138 (or (not (featurep 'vc-hooks))
1138 (and (vc-backend file) 1139 (and (vc-backend file)
1139 (if (fboundp 'vc-state) 1140 (if (fboundp 'vc-state)
1140 (or (memq (vc-state file) '(edited needs-merge)) 1141 (or (memq (vc-state file) '(edited needs-merge))
1141 (stringp (vc-state file))) 1142 (stringp (vc-state file)))
1142 ;; XEmacs has no vc-state 1143 ;; XEmacs has no vc-state
1143 (vc-locking-user file)) 1144 (vc-locking-user file))
1144 ))) 1145 )))
1145 1146
1146 (defsubst ediff-file-checked-in-p (file) 1147 (defun ediff-file-checked-in-p (file)
1147 (and (featurep 'vc-hooks) 1148 (and (featurep 'vc-hooks)
1148 ;; CVS files are considered not checked in 1149 ;; CVS files are considered not checked in
1149 (not (memq (vc-backend file) '(nil CVS))) 1150 (not (memq (vc-backend file) '(nil CVS)))
1150 (if (fboundp 'vc-state) 1151 (if (fboundp 'vc-state)
1151 (and 1152 (and
3077 (ediff-delete-overlay current-diff-overlay)) 3078 (ediff-delete-overlay current-diff-overlay))
3078 (set current-diff-overlay-var nil) 3079 (set current-diff-overlay-var nil)
3079 ))) 3080 )))
3080 3081
3081 3082
3082 (defsubst ediff-highlight-diff (n) 3083 (defun ediff-highlight-diff (n)
3083 "Put face on diff N. Invoked for X displays only." 3084 "Put face on diff N. Invoked for X displays only."
3084 (ediff-highlight-diff-in-one-buffer n 'A) 3085 (ediff-highlight-diff-in-one-buffer n 'A)
3085 (ediff-highlight-diff-in-one-buffer n 'B) 3086 (ediff-highlight-diff-in-one-buffer n 'B)
3086 (ediff-highlight-diff-in-one-buffer n 'C) 3087 (ediff-highlight-diff-in-one-buffer n 'C)
3087 (ediff-highlight-diff-in-one-buffer n 'Ancestor) 3088 (ediff-highlight-diff-in-one-buffer n 'Ancestor)
3088 ) 3089 )
3089 3090
3090 3091
3091 (defsubst ediff-unhighlight-diff () 3092 (defun ediff-unhighlight-diff ()
3092 "Remove overlays from buffers A, B, and C." 3093 "Remove overlays from buffers A, B, and C."
3093 (ediff-unhighlight-diff-in-one-buffer 'A) 3094 (ediff-unhighlight-diff-in-one-buffer 'A)
3094 (ediff-unhighlight-diff-in-one-buffer 'B) 3095 (ediff-unhighlight-diff-in-one-buffer 'B)
3095 (ediff-unhighlight-diff-in-one-buffer 'C) 3096 (ediff-unhighlight-diff-in-one-buffer 'C)
3096 (ediff-unhighlight-diff-in-one-buffer 'Ancestor) 3097 (ediff-unhighlight-diff-in-one-buffer 'Ancestor)
3097 ) 3098 )
3098 3099
3099 ;; delete highlighting overlays, restore faces to their original form 3100 ;; delete highlighting overlays, restore faces to their original form
3100 (defsubst ediff-unhighlight-diffs-totally () 3101 (defun ediff-unhighlight-diffs-totally ()
3101 (ediff-unhighlight-diffs-totally-in-one-buffer 'A) 3102 (ediff-unhighlight-diffs-totally-in-one-buffer 'A)
3102 (ediff-unhighlight-diffs-totally-in-one-buffer 'B) 3103 (ediff-unhighlight-diffs-totally-in-one-buffer 'B)
3103 (ediff-unhighlight-diffs-totally-in-one-buffer 'C) 3104 (ediff-unhighlight-diffs-totally-in-one-buffer 'C)
3104 (ediff-unhighlight-diffs-totally-in-one-buffer 'Ancestor) 3105 (ediff-unhighlight-diffs-totally-in-one-buffer 'Ancestor)
3105 ) 3106 )
3684 (goto-char beg) 3685 (goto-char beg)
3685 (skip-chars-forward ediff-whitespace) 3686 (skip-chars-forward ediff-whitespace)
3686 (>= (point) end)))))) 3687 (>= (point) end))))))
3687 3688
3688 3689
3689 (defsubst ediff-get-region-contents (n buf-type ctrl-buf &optional start end) 3690 (defun ediff-get-region-contents (n buf-type ctrl-buf &optional start end)
3690 (ediff-with-current-buffer 3691 (ediff-with-current-buffer
3691 (ediff-with-current-buffer ctrl-buf (ediff-get-buffer buf-type)) 3692 (ediff-with-current-buffer ctrl-buf (ediff-get-buffer buf-type))
3692 (buffer-substring 3693 (buffer-substring
3693 (or start (ediff-get-diff-posn buf-type 'beg n ctrl-buf)) 3694 (or start (ediff-get-diff-posn buf-type 'beg n ctrl-buf))
3694 (or end (ediff-get-diff-posn buf-type 'end n ctrl-buf))))) 3695 (or end (ediff-get-diff-posn buf-type 'end n ctrl-buf)))))
3943 (let ((reporter-prompt-for-summary-p t) 3944 (let ((reporter-prompt-for-summary-p t)
3944 (ctl-buf ediff-control-buffer) 3945 (ctl-buf ediff-control-buffer)
3945 (ediff-device-type (ediff-device-type)) 3946 (ediff-device-type (ediff-device-type))
3946 varlist salutation buffer-name) 3947 varlist salutation buffer-name)
3947 (setq varlist '(ediff-diff-program ediff-diff-options 3948 (setq varlist '(ediff-diff-program ediff-diff-options
3949 ediff-diff3-program ediff-diff3-options
3948 ediff-patch-program ediff-patch-options 3950 ediff-patch-program ediff-patch-options
3949 ediff-shell 3951 ediff-shell
3950 ediff-use-faces 3952 ediff-use-faces
3951 ediff-auto-refine ediff-highlighting-style 3953 ediff-auto-refine ediff-highlighting-style
3952 ediff-buffer-A ediff-buffer-B ediff-control-buffer 3954 ediff-buffer-A ediff-buffer-B ediff-control-buffer
4298 ;; don't report error if version control package wasn't found 4300 ;; don't report error if version control package wasn't found
4299 ;;(ediff-load-version-control 'silent) 4301 ;;(ediff-load-version-control 'silent)
4300 4302
4301 (run-hooks 'ediff-load-hook) 4303 (run-hooks 'ediff-load-hook)
4302 4304
4305 (provide 'ediff-util)
4306
4303 4307
4304 ;;; Local Variables: 4308 ;;; Local Variables:
4305 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) 4309 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
4306 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) 4310 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
4307 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) 4311 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))