]> code.delx.au - gnu-emacs/commitdiff
2000-05-24 Michael Kifer <kifer@cs.sunysb.edu>
authorMichael Kifer <kifer@cs.stonybrook.edu>
Wed, 24 May 2000 17:31:16 +0000 (17:31 +0000)
committerMichael Kifer <kifer@cs.stonybrook.edu>
Wed, 24 May 2000 17:31:16 +0000 (17:31 +0000)
* ediff-diff.el (ediff-forward-word): take syntactic word class into
account.
(ediff-test-utility,ediff-diff-mandatory-option,
ediff-reset-diff-options): utilities for proper initialization of
ediff-diff-options and ediff-diff3-options on Windows.

* ediff-init.el (ediff-merge-filename-prefix): new customizable
variable.

* ediff-mult.el (ediff-filegroup-action): use
ediff-merge-filename-prefix.

lisp/ChangeLog
lisp/ediff-diff.el
lisp/ediff-init.el
lisp/ediff-mult.el
man/ediff.texi
man/viper.texi

index f88d60fa654c8d855c4b327a433ef7e9b9e1695a..b0cb1f311680b99f105ebe35b2aa9d6d80528131 100644 (file)
@@ -1,3 +1,17 @@
+2000-05-24  Michael Kifer  <kifer@cs.sunysb.edu>
+       
+       * ediff-diff.el (ediff-forward-word): take syntactic word class into
+       account.
+       (ediff-test-utility,ediff-diff-mandatory-option,
+       ediff-reset-diff-options): utilities for proper initialization of
+       ediff-diff-options and ediff-diff3-options on Windows.
+       
+       * ediff-init.el (ediff-merge-filename-prefix): new customizable
+       variable.
+       
+       * ediff-mult.el (ediff-filegroup-action): use
+       ediff-merge-filename-prefix.
+
 2000-05-24  Michael Kifer  <kifer@cs.sunysb.edu>
 
        * viper-ex.el (ex-write): set selective display to nil.
index ac26f522b5dd42537a2dceb17be2ce2e9332942c..3311977d581f512e6e80a3b41980cb286569b604 100644 (file)
   :group 'ediff)
 
 
+;; The following functions needed for setting diff/diff3 options
+;; test if diff supports the --binary option
+(defsubst ediff-test-utility (diff-util option &optional files)
+  (zerop (apply 'call-process
+               (append (list diff-util nil nil nil option) files))))
+
+(defun ediff-diff-mandatory-option (diff-util)
+  (let ((file (if (boundp 'null-device) null-device "/dev/null")))
+    (cond  ((not (memq system-type '(ms-dos windows-nt windows-95)))
+           "")
+          ((and (string= diff-util ediff-diff-program)
+                (ediff-test-utility
+                 ediff-diff-program "--binary" (list file file)))
+           "--binary")
+          ((and (string= diff-util ediff-diff3-program)
+                (ediff-test-utility
+                 ediff-diff3-program "--binary" (list file file file)))
+           "--binary")
+          (t ""))))
+
+;; make sure that mandatory options are added even if the user changes
+;; ediff-diff-options or ediff-diff3-options in the customization widget
+(defun ediff-reset-diff-options (symb val)
+  (let* ((diff-program 
+         (if (eq symb 'ediff-diff-options) 
+             ediff-diff-program
+           ediff-diff3-program))
+        (mandatory-option (ediff-diff-mandatory-option diff-program))
+        (spacer (if (string-equal mandatory-option "") "" " ")))
+    (set symb 
+        (if (string-match mandatory-option val)
+            val
+          (concat mandatory-option spacer val)))
+    ))
+
+
 (defcustom ediff-shell
   (cond ((eq system-type 'emx) "cmd") ; OS/2
        ((memq system-type '(ms-dos windows-nt windows-95))
@@ -76,11 +112,12 @@ ignore changes whose lines all match RE."
   "*Program to use for generating the differential of the two files."
   :type 'string
   :group 'ediff-diff)
-(defcustom ediff-diff-options ""  
+(defcustom ediff-diff-options ""
   "*Options to pass to `ediff-diff-program'. 
 If diff\(1\) is used as `ediff-diff-program', then the most useful options are
 `-w', to ignore space, and `-i', to ignore case of letters.
 At present, the option `-c' is not allowed."
+  :set 'ediff-reset-diff-options
   :type 'string
   :group 'ediff-diff)
 
@@ -105,6 +142,7 @@ Must produce output compatible with Unix's diff3 program."
   :group 'ediff-diff)
 (defcustom ediff-diff3-options ""  
   "*Options to pass to `ediff-diff3-program'."
+  :set 'ediff-reset-diff-options
   :type 'string
   :group 'ediff-diff)
 (defcustom ediff-diff3-ok-lines-regexp
@@ -1173,8 +1211,7 @@ Used for splitting difference regions into individual words.")
   "*Characters constituting white space.
 These characters are ignored when differing regions are split into words.")
 
-;;(defvar ediff-word-1 "a-zA-Z---_`'.?!:"
-(defvar ediff-word-1 "a-zA-Z---_"
+(defvar ediff-word-1 "\\(a-zA-Z---_\\|\w\\)"
   "*Characters that constitute words of type 1.
 More precisely, [ediff-word-1] is a regexp that matches type 1 words.
 See `ediff-forward-word' for more details.")  
@@ -1201,9 +1238,11 @@ See `ediff-forward-word' for more details.")
   "Move point one word forward.
 There are four types of words, each of which consists entirely of
 characters in `ediff-word-1', `ediff-word-2', `ediff-word-3', or
-`ediff-word-4'.  Words are recognized by passing these in turn as the
-argument to `skip-chars-forward'."
-  (or (> (skip-chars-forward ediff-word-1) 0)
+`ediff-word-4'.  Words are recognized by passing these one after another as
+arguments to `skip-chars-forward'."
+  (or (> (+ (skip-chars-forward ediff-word-1)
+           (skip-syntax-forward "w"))
+        0)
       (> (skip-chars-forward ediff-word-2) 0)
       (> (skip-chars-forward ediff-word-3) 0)
       (> (skip-chars-forward ediff-word-4) 0)
index 08490c4c16ceb885b735f33cf2b917a663744da3..438492032baf2ef6c85b3a2498a104535d1ce6f1 100644 (file)
@@ -1206,6 +1206,11 @@ as `ediff-merge-directory' or `ediff-merge-directory-revisions'."
 
 ;; file where the result of the merge is to be saved.  used internally
 (ediff-defvar-local ediff-merge-store-file nil "")
+
+(defcustom ediff-merge-filename-prefix "merge_"
+  "*Prefix to be attached to saved merge buffers."
+  :type 'string
+  :group 'ediff-merge)
   
 (defcustom ediff-no-emacs-help-in-control-buffer nil
   "*Non-nil means C-h should not invoke Emacs help in control buffer.
index 39ffc834d9d5efa9a5681f221495413c475b2494..2246426a741b298940e23ab6c47d46c0af1df269 100644 (file)
@@ -1587,7 +1587,7 @@ all marked sessions must be active."
                                         merge-autostore-dir)
                                        (concat
                                         merge-autostore-dir
-                                        "merge_"
+                                        ediff-merge-filename-prefix
                                         (file-name-nondirectory file1))
                                      ))
                             ;; make ediff-startup pass
@@ -1618,7 +1618,7 @@ all marked sessions must be active."
                                           merge-autostore-dir)
                                          (concat
                                           merge-autostore-dir
-                                          "merge_"
+                                          ediff-merge-filename-prefix
                                           (file-name-nondirectory file1))) )
                               ;; make ediff-startup pass
                               ;; ediff-control-buffer back to the meta
@@ -1647,7 +1647,7 @@ all marked sessions must be active."
                                           merge-autostore-dir)
                                          (concat
                                           merge-autostore-dir
-                                          "merge_"
+                                          ediff-merge-filename-prefix
                                           (file-name-nondirectory file1))) )
                               ;; make ediff-startup pass
                               ;; ediff-control-buffer back to the meta
@@ -1673,7 +1673,7 @@ all marked sessions must be active."
                                           merge-autostore-dir)
                                          (concat
                                           merge-autostore-dir
-                                          "merge_"
+                                          ediff-merge-filename-prefix
                                           (file-name-nondirectory file1))) )
                               (setq ediff-meta-buffer , (current-buffer)
                                     ediff-meta-session-number
index d0832ec68f545b8c7ab99454589d5ea07cfdd402..d3d28cd531a44ec960df4562b9b9f5c9ee8867b7 100644 (file)
@@ -975,8 +975,8 @@ invoked from a session group.  This behavior is implemented in the function
 necessary.
 
 The variable @code{ediff-autostore-merges} is buffer-local, so it can be
-set in a per-buffer manner.  Therefore, use @code{setq-default} to globally
-change this variable.
+set on a per-buffer basis.  Therefore, use @code{setq-default} to change
+this variable globally.
 
 @cindex Multi-file patches
 A multi-file patch is a concatenated output of several runs of the Unix
@@ -1980,6 +1980,12 @@ The variable @code{ediff-autostore-merges} is buffer-local, so it can be
 set in a per-buffer manner.  Therefore, use @code{setq-default} to globally
 change this variable.
 
+@vindex ediff-merge-filename-prefix
+When merge buffers are saved automatically as directed by
+@code{ediff-autostore-merges}, Ediff attaches a prefix to each file, as
+specified by the variable @code{ediff-merge-filename-prefix}. The default
+is @code{merge_}, but this can be changed by the user.
+
 @node Support for Version Control, Customizing the Mode Line, Merging and diff3, Customization
 @section Support for Version Control
 
index 655a8c5983bdda1e8a2f8e31c22d5a6e991886cb..5c5ca62063a4328a69e3bf05182acd1c83645d10 100644 (file)
@@ -2031,7 +2031,8 @@ If you wish to change a Viper binding, you can use the
 @code{define-key} command, to modify @code{viper-vi-global-user-map},
 @code{viper-insert-global-user-map}, and @code{viper-emacs-global-user-map}, as
 explained below.  Each of these key maps affects the corresponding Viper state.
-The keymap @code{viper-vi-global-user-map} also affects Viper's Replace state.
+The keymap @code{viper-insert-global-user-map} also affects Viper's Replace
+state. 
 
 @noindent
 If you want to
@@ -4442,6 +4443,7 @@ kanze@@gabi-soft.fr (James Kanze),
 kin@@isi.com (Kin Cho),
 kwzh@@gnu.org (Karl Heuer),
 lindstro@@biostat.wisc.edu (Mary Lindstrom),
+minakaji@@osaka.email.ne.jp (Mikio Nakajima),
 Mark.Bordas@@East.Sun.COM (Mark Bordas),
 meyering@@comco.com (Jim Meyering),
 mrb@@Eng.Sun.COM (Martin Buchholz),