aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kifer2007-11-02 06:03:12 +0000
committerMichael Kifer2007-11-02 06:03:12 +0000
commit33468a59c6b42e489bc8ae147c43818d8b76a2a7 (patch)
tree22f2abf83551c006bcc231dcb890e1dac202f48c
parent246a4316dea32514edf84e9e2552627327149160 (diff)
downloademacs-33468a59c6b42e489bc8ae147c43818d8b76a2a7.tar.gz
emacs-33468a59c6b42e489bc8ae147c43818d8b76a2a7.zip
2007-11-02 Michael Kifer <kifer@cs.stonybrook.edu>
* viper-ex.el (viper-ex): do not ignore the region. * viper-cmd.el (viper-prev-destructive-command) (viper-insert-prev-from-insertion-ring): use ring-copy instead of copy-sequence. * ediff-util.el (ediff-make-current-diff-overlay): do not use face-name. Got rid of ediff-copy-list. * ediff-diff.el (ediff-set-fine-diff-properties-in-one-buffer): do not use face-name. (ediff-test-utility,ediff-diff-mandatory-option) (ediff-reset-diff-options): removed to simplify yhe mandatory option handling on windows. (ediff-set-diff-options): added. (ediff-diff-options): changed. * ediff-vers.el (ediff-vc-internal): use ediff-vc-revision-other-window. (ediff-vc-merge-internal): use ediff-vc-revision-other-window and ediff-vc-working-revision. Require vc-hooks.
-rw-r--r--ChangeLog24
-rw-r--r--lisp/ediff-diff.el59
-rw-r--r--lisp/ediff-util.el20
-rw-r--r--lisp/ediff-vers.el26
-rw-r--r--lisp/emulation/viper-cmd.el7
-rw-r--r--lisp/emulation/viper-ex.el24
6 files changed, 79 insertions, 81 deletions
diff --git a/ChangeLog b/ChangeLog
index fd23fce5da3..7778b5364ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
12007-11-02 Michael Kifer <kifer@cs.stonybrook.edu>
2
3 * viper-ex.el (viper-ex): do not ignore the region.
4
5 * viper-cmd.el (viper-prev-destructive-command)
6 (viper-insert-prev-from-insertion-ring): use ring-copy instead of
7 copy-sequence.
8
9 * ediff-util.el (ediff-make-current-diff-overlay): do not use face-name.
10 Got rid of ediff-copy-list.
11
12 * ediff-diff.el (ediff-set-fine-diff-properties-in-one-buffer): do not
13 use face-name.
14 (ediff-test-utility,ediff-diff-mandatory-option)
15 (ediff-reset-diff-options): removed to simplify yhe mandatory option
16 handling on windows.
17 (ediff-set-diff-options): added.
18 (ediff-diff-options): changed.
19
20 * ediff-vers.el (ediff-vc-internal): use ediff-vc-revision-other-window.
21 (ediff-vc-merge-internal): use ediff-vc-revision-other-window and
22 ediff-vc-working-revision.
23 Require vc-hooks.
24
12007-11-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 252007-11-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 26
3 * configure.in: Remove HAVE_X11R5 check. 27 * configure.in: Remove HAVE_X11R5 check.
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el
index 451f87e142d..06d7b603440 100644
--- a/lisp/ediff-diff.el
+++ b/lisp/ediff-diff.el
@@ -48,7 +48,6 @@
48 :prefix "ediff-" 48 :prefix "ediff-"
49 :group 'ediff) 49 :group 'ediff)
50 50
51;; these two must be here to prevent ediff-test-utility from barking
52(defcustom ediff-diff-program "diff" 51(defcustom ediff-diff-program "diff"
53 "*Program to use for generating the differential of the two files." 52 "*Program to use for generating the differential of the two files."
54 :type 'string 53 :type 'string
@@ -62,46 +61,8 @@ Must produce output compatible with Unix's diff3 program."
62 61
63;; The following functions must precede all defcustom-defined variables. 62;; The following functions must precede all defcustom-defined variables.
64 63
65;; The following functions needed for setting diff/diff3 options
66;; test if diff supports the --binary option
67(defsubst ediff-test-utility (diff-util option &optional files)
68 (condition-case nil
69 (eq 0 (apply 'call-process
70 (append (list diff-util nil nil nil option) files)))
71 (error (format "Cannot execute program %S." diff-util)))
72 )
73
74(defun ediff-diff-mandatory-option (diff-util)
75 (let ((file (if (boundp 'null-device) null-device "/dev/null")))
76 (cond ((not (memq system-type '(ms-dos windows-nt windows-95)))
77 "")
78 ((and (string= diff-util ediff-diff-program)
79 (ediff-test-utility
80 ediff-diff-program "--binary" (list file file)))
81 "--binary ")
82 ((and (string= diff-util ediff-diff3-program)
83 (ediff-test-utility
84 ediff-diff3-program "--binary" (list file file file)))
85 "--binary ")
86 (t ""))))
87
88
89;; must be before ediff-reset-diff-options to avoid compiler errors
90(fset 'ediff-set-actual-diff-options '(lambda () nil)) 64(fset 'ediff-set-actual-diff-options '(lambda () nil))
91 65
92;; make sure that mandatory options are added even if the user changes
93;; ediff-diff-options or ediff-diff3-options in the customization widget
94(defun ediff-reset-diff-options (symb val)
95 (let* ((diff-program
96 (if (eq symb 'ediff-diff-options)
97 ediff-diff-program
98 ediff-diff3-program))
99 (mandatory-option (ediff-diff-mandatory-option diff-program)))
100 (set symb (concat mandatory-option val))
101 (ediff-set-actual-diff-options)
102 ))
103
104
105(defcustom ediff-shell 66(defcustom ediff-shell
106 (cond ((eq system-type 'emx) "cmd") ; OS/2 67 (cond ((eq system-type 'emx) "cmd") ; OS/2
107 ((memq system-type '(ms-dos windows-nt windows-95)) 68 ((memq system-type '(ms-dos windows-nt windows-95))
@@ -130,17 +91,25 @@ are `-I REGEXP', to ignore changes whose lines match the REGEXP."
130 :type '(repeat string) 91 :type '(repeat string)
131 :group 'ediff-diff) 92 :group 'ediff-diff)
132 93
133(defcustom ediff-diff-options "" 94(defun ediff-set-diff-options (symbol value)
95 (set symbol value)
96 (ediff-set-actual-diff-options))
97
98(defcustom ediff-diff-options
99 (if (memq system-type '(ms-dos windows-nt windows-95)) "--binary" "")
134 "*Options to pass to `ediff-diff-program'. 100 "*Options to pass to `ediff-diff-program'.
135If Unix diff is used as `ediff-diff-program', 101If Unix diff is used as `ediff-diff-program',
136then a useful option is `-w', to ignore space. 102then a useful option is `-w', to ignore space.
137Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be 103Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be
138toggled interactively using \\[ediff-toggle-ignore-case]. 104toggled interactively using \\[ediff-toggle-ignore-case].
139 105
106Do not remove the default options. If you need to change this variable, add new
107options after the default ones.
108
140This variable is not for customizing the look of the differences produced by 109This variable is not for customizing the look of the differences produced by
141the command \\[ediff-show-diff-output]. Use the variable 110the command \\[ediff-show-diff-output]. Use the variable
142`ediff-custom-diff-options' for that." 111`ediff-custom-diff-options' for that."
143 :set 'ediff-reset-diff-options 112 :set 'ediff-set-diff-options
144 :type 'string 113 :type 'string
145 :group 'ediff-diff) 114 :group 'ediff-diff)
146 115
@@ -179,7 +148,7 @@ This output is not used by Ediff internally."
179 "Pattern to match lines produced by diff3 that describe differences.") 148 "Pattern to match lines produced by diff3 that describe differences.")
180(defcustom ediff-diff3-options "" 149(defcustom ediff-diff3-options ""
181 "*Options to pass to `ediff-diff3-program'." 150 "*Options to pass to `ediff-diff3-program'."
182 :set 'ediff-reset-diff-options 151 :set 'ediff-set-diff-options
183 :type 'string 152 :type 'string
184 :group 'ediff-diff) 153 :group 'ediff-diff)
185 154
@@ -889,9 +858,9 @@ one optional arguments, diff-number to refine.")
889 (let ((fine-diff-vector (ediff-get-fine-diff-vector n buf-type)) 858 (let ((fine-diff-vector (ediff-get-fine-diff-vector n buf-type))
890 (face (if default 859 (face (if default
891 'default 860 'default
892 (face-name 861 (ediff-get-symbol-from-alist
893 (ediff-get-symbol-from-alist 862 buf-type ediff-fine-diff-face-alist)
894 buf-type ediff-fine-diff-face-alist)))) 863 ))
895 (priority (if default 864 (priority (if default
896 0 865 0
897 (1+ (or (ediff-overlay-get 866 (1+ (or (ediff-overlay-get
diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el
index 3bc82dd4daf..f3cffe0847f 100644
--- a/lisp/ediff-util.el
+++ b/lisp/ediff-util.el
@@ -3802,9 +3802,8 @@ Ediff Control Panel to restore highlighting."
3802 (let ((overlay (ediff-get-symbol-from-alist 3802 (let ((overlay (ediff-get-symbol-from-alist
3803 type ediff-current-diff-overlay-alist)) 3803 type ediff-current-diff-overlay-alist))
3804 (buffer (ediff-get-buffer type)) 3804 (buffer (ediff-get-buffer type))
3805 (face (face-name 3805 (face (ediff-get-symbol-from-alist
3806 (ediff-get-symbol-from-alist 3806 type ediff-current-diff-face-alist)))
3807 type ediff-current-diff-face-alist))))
3808 (set overlay 3807 (set overlay
3809 (ediff-make-bullet-proof-overlay (point-max) (point-max) buffer)) 3808 (ediff-make-bullet-proof-overlay (point-max) (point-max) buffer))
3810 (ediff-set-overlay-face (symbol-value overlay) face) 3809 (ediff-set-overlay-face (symbol-value overlay) face)
@@ -4292,20 +4291,7 @@ Mail anyway? (y or n) ")
4292 (add-to-history history-var newelt) 4291 (add-to-history history-var newelt)
4293 (set history-var (cons newelt (symbol-value history-var))))) 4292 (set history-var (cons newelt (symbol-value history-var)))))
4294 4293
4295(if (fboundp 'copy-sequence) 4294(defalias 'ediff-copy-list 'copy-sequence)
4296 (defalias 'ediff-copy-list 'copy-sequence)
4297 (defun ediff-copy-list (list)
4298 (if (consp list)
4299 ;;;(let ((res nil))
4300 ;;; (while (consp list) (push (pop list) res))
4301 ;;; (prog1 (nreverse res) (setcdr res list)))
4302 (let (res elt)
4303 (while (consp list)
4304 (setq elt (car list)
4305 res (cons elt res)
4306 list (cdr list)))
4307 (nreverse res))
4308 (car list))))
4309 4295
4310 4296
4311;; don't report error if version control package wasn't found 4297;; don't report error if version control package wasn't found
diff --git a/lisp/ediff-vers.el b/lisp/ediff-vers.el
index 98c1defc212..8ce2bcb2021 100644
--- a/lisp/ediff-vers.el
+++ b/lisp/ediff-vers.el
@@ -52,8 +52,22 @@ comparison or merge operations are being performed."
52 :group 'ediff-vers 52 :group 'ediff-vers
53 ) 53 )
54 54
55(defalias 'ediff-vc-revision-other-window
56 (if (fboundp 'vc-revision-other-window)
57 'vc-revision-other-window
58 'vc-version-other-window))
59
60(defalias 'ediff-vc-working-revision
61 (if (fboundp 'vc-working-revision)
62 'vc-working-revision
63 vc-workfile-version))
64
55;; VC.el support 65;; VC.el support
56 66
67(eval-when-compile
68 (require 'vc-hooks)) ;; for vc-call macro
69
70
57(defun ediff-vc-latest-version (file) 71(defun ediff-vc-latest-version (file)
58 "Return the version level of the latest version of FILE in repository." 72 "Return the version level of the latest version of FILE in repository."
59 (if (fboundp 'vc-latest-version) 73 (if (fboundp 'vc-latest-version)
@@ -77,12 +91,12 @@ comparison or merge operations are being performed."
77 (setq rev1 (ediff-vc-latest-version (buffer-file-name)))) 91 (setq rev1 (ediff-vc-latest-version (buffer-file-name))))
78 (save-window-excursion 92 (save-window-excursion
79 (save-excursion 93 (save-excursion
80 (vc-revision-other-window rev1) 94 (ediff-vc-revision-other-window rev1)
81 (setq rev1buf (current-buffer) 95 (setq rev1buf (current-buffer)
82 file1 (buffer-file-name))) 96 file1 (buffer-file-name)))
83 (save-excursion 97 (save-excursion
84 (or (string= rev2 "") ; use current buffer 98 (or (string= rev2 "") ; use current buffer
85 (vc-revision-other-window rev2)) 99 (ediff-vc-revision-other-window rev2))
86 (setq rev2buf (current-buffer) 100 (setq rev2buf (current-buffer)
87 file2 (buffer-file-name))) 101 file2 (buffer-file-name)))
88 (setq startup-hooks 102 (setq startup-hooks
@@ -158,17 +172,17 @@ comparison or merge operations are being performed."
158 (let (buf1 buf2 ancestor-buf) 172 (let (buf1 buf2 ancestor-buf)
159 (save-window-excursion 173 (save-window-excursion
160 (save-excursion 174 (save-excursion
161 (vc-revision-other-window rev1) 175 (ediff-vc-revision-other-window rev1)
162 (setq buf1 (current-buffer))) 176 (setq buf1 (current-buffer)))
163 (save-excursion 177 (save-excursion
164 (or (string= rev2 "") 178 (or (string= rev2 "")
165 (vc-revision-other-window rev2)) 179 (ediff-vc-revision-other-window rev2))
166 (setq buf2 (current-buffer))) 180 (setq buf2 (current-buffer)))
167 (if ancestor-rev 181 (if ancestor-rev
168 (save-excursion 182 (save-excursion
169 (if (string= ancestor-rev "") 183 (if (string= ancestor-rev "")
170 (setq ancestor-rev (vc-working-revision buffer-file-name))) 184 (setq ancestor-rev (ediff-vc-working-revision buffer-file-name)))
171 (vc-revision-other-window ancestor-rev) 185 (ediff-vc-revision-other-window ancestor-rev)
172 (setq ancestor-buf (current-buffer)))) 186 (setq ancestor-buf (current-buffer))))
173 (setq startup-hooks 187 (setq startup-hooks
174 (cons 188 (cons
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 82dc312cf28..88af961e488 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -1902,7 +1902,7 @@ With prefix argument, find next destructive command."
1902 (setq viper-intermediate-command 1902 (setq viper-intermediate-command
1903 'repeating-display-destructive-command) 1903 'repeating-display-destructive-command)
1904 ;; first search through command history--set temp ring 1904 ;; first search through command history--set temp ring
1905 (setq viper-temp-command-ring (copy-sequence viper-command-ring))) 1905 (setq viper-temp-command-ring (ring-copy viper-command-ring)))
1906 (setq cmd (if next 1906 (setq cmd (if next
1907 (viper-special-ring-rotate1 viper-temp-command-ring 1) 1907 (viper-special-ring-rotate1 viper-temp-command-ring 1)
1908 (viper-special-ring-rotate1 viper-temp-command-ring -1))) 1908 (viper-special-ring-rotate1 viper-temp-command-ring -1)))
@@ -1936,7 +1936,7 @@ to in the global map, instead of cycling through the insertion ring."
1936 (length viper-last-inserted-string-from-insertion-ring)))) 1936 (length viper-last-inserted-string-from-insertion-ring))))
1937 ) 1937 )
1938 ;;first search through insertion history 1938 ;;first search through insertion history
1939 (setq viper-temp-insertion-ring (copy-sequence viper-insertion-ring))) 1939 (setq viper-temp-insertion-ring (ring-copy viper-insertion-ring)))
1940 (setq this-command 'viper-insert-from-insertion-ring) 1940 (setq this-command 'viper-insert-from-insertion-ring)
1941 ;; so that things will be undone properly 1941 ;; so that things will be undone properly
1942 (setq buffer-undo-list (cons nil buffer-undo-list)) 1942 (setq buffer-undo-list (cons nil buffer-undo-list))
@@ -2790,6 +2790,7 @@ On reaching beginning of line, stop and signal error."
2790 2790
2791(defun viper-next-line-carefully (arg) 2791(defun viper-next-line-carefully (arg)
2792 (condition-case nil 2792 (condition-case nil
2793 ;; do not use forward-line! need to keep column
2793 (next-line arg) 2794 (next-line arg)
2794 (error nil))) 2795 (error nil)))
2795 2796
@@ -3089,6 +3090,7 @@ On reaching beginning of line, stop and signal error."
3089 (let ((val (viper-p-val arg)) 3090 (let ((val (viper-p-val arg))
3090 (com (viper-getCom arg))) 3091 (com (viper-getCom arg)))
3091 (if com (viper-move-marker-locally 'viper-com-point (point))) 3092 (if com (viper-move-marker-locally 'viper-com-point (point)))
3093 ;; do not use forward-line! need to keep column
3092 (next-line val) 3094 (next-line val)
3093 (if viper-ex-style-motion 3095 (if viper-ex-style-motion
3094 (if (and (eolp) (not (bolp))) (backward-char 1))) 3096 (if (and (eolp) (not (bolp))) (backward-char 1)))
@@ -3132,6 +3134,7 @@ If point is on a widget or a button, simulate clicking on that widget/button."
3132 (let ((val (viper-p-val arg)) 3134 (let ((val (viper-p-val arg))
3133 (com (viper-getCom arg))) 3135 (com (viper-getCom arg)))
3134 (if com (viper-move-marker-locally 'viper-com-point (point))) 3136 (if com (viper-move-marker-locally 'viper-com-point (point)))
3137 ;; do not use forward-line! need to keep column
3135 (previous-line val) 3138 (previous-line val)
3136 (if viper-ex-style-motion 3139 (if viper-ex-style-motion
3137 (if (and (eolp) (not (bolp))) (backward-char 1))) 3140 (if (and (eolp) (not (bolp))) (backward-char 1)))
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index 627d2ff1814..d9cc97719ca 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -651,17 +651,19 @@ reversed."
651 (setq initial-str (format "%d,%d" reg-beg-line reg-end-line))) 651 (setq initial-str (format "%d,%d" reg-beg-line reg-end-line)))
652 652
653 (setq com-str 653 (setq com-str
654 (or string (viper-read-string-with-history 654 (if string
655 ":" 655 (concat initial-str string)
656 initial-str 656 (viper-read-string-with-history
657 'viper-ex-history 657 ":"
658 ;; no default when working on region 658 initial-str
659 (if initial-str 659 'viper-ex-history
660 nil 660 ;; no default when working on region
661 (car viper-ex-history)) 661 (if initial-str
662 map 662 nil
663 (if initial-str 663 (car viper-ex-history))
664 " [Type command to execute on current region]")))) 664 map
665 (if initial-str
666 " [Type command to execute on current region]"))))
665 (save-window-excursion 667 (save-window-excursion
666 ;; just a precaution 668 ;; just a precaution
667 (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) 669 (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))