]> code.delx.au - gnu-emacs/blobdiff - lisp/ediff-diff.el
(dired-pop-to-buffer): Try to make this behave the
[gnu-emacs] / lisp / ediff-diff.el
index 842be4787d33ed6386b33f2eaa8d8ea2542b4e3e..75379f3da7a75c7d82557d9fa15c49e0b1578801 100644 (file)
@@ -1,7 +1,7 @@
 ;;; ediff-diff.el --- diff-related utilities
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-;;   2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
   :group 'ediff)
 
 (defcustom ediff-diff-program "diff"
-  "*Program to use for generating the differential of the two files."
+  "Program to use for generating the differential of the two files."
   :type 'string
   :group 'ediff-diff)
 (defcustom ediff-diff3-program "diff3"
-  "*Program to be used for three-way comparison.
+  "Program to be used for three-way comparison.
 Must produce output compatible with Unix's diff3 program."
   :type 'string
   :group 'ediff-diff)
@@ -56,9 +56,8 @@ Must produce output compatible with Unix's diff3 program."
   (cond ((eq system-type 'emx) "cmd") ; OS/2
        ((memq system-type '(ms-dos windows-nt windows-95))
         shell-file-name) ; no standard name on MS-DOS
-       ((memq system-type '(vax-vms axp-vms)) "*dcl*") ; VMS
        (t  "sh")) ; UNIX
-  "*The shell used to run diff and patch.
+  "The shell used to run diff and patch.
 If user's .profile or .cshrc files are set up correctly, any shell
 will do.  However, some people set $prompt or other things
 incorrectly, which leads to undesirable output messages.  These may
@@ -68,13 +67,13 @@ you are not using or, better, fix your shell's startup file."
   :group 'ediff-diff)
 
 (defcustom ediff-cmp-program "cmp"
-  "*Utility to use to determine if two files are identical.
+  "Utility to use to determine if two files are identical.
 It must return code 0, if its arguments are identical files."
   :type 'string
   :group 'ediff-diff)
 
 (defcustom ediff-cmp-options nil
-  "*Options to pass to `ediff-cmp-program'.
+  "Options to pass to `ediff-cmp-program'.
 If GNU diff is used as `ediff-cmp-program', then the most useful options
 are `-I REGEXP', to ignore changes whose lines match the REGEXP."
   :type '(repeat string)
@@ -86,7 +85,7 @@ are `-I REGEXP', to ignore changes whose lines match the REGEXP."
 
 (defcustom ediff-diff-options
   (if (memq system-type '(ms-dos windows-nt windows-95)) "--binary" "")
-  "*Options to pass to `ediff-diff-program'.
+  "Options to pass to `ediff-diff-program'.
 If Unix diff is used as `ediff-diff-program',
 then a useful option is `-w', to ignore space.
 Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be
@@ -108,12 +107,12 @@ 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."
+  "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.
+  "Option that causes the diff3 program to ignore case of letters.
 GNU diff3 doesn't have such an option."
   :type 'string
   :group 'ediff-diff)
@@ -122,12 +121,12 @@ GNU diff3 doesn't have such an option."
 (ediff-defvar-local ediff-actual-diff-options ediff-diff-options "")
 
 (defcustom ediff-custom-diff-program ediff-diff-program
-  "*Program to use for generating custom diff output for saving it in a file.
+  "Program to use for generating custom diff output for saving it in a file.
 This output is not used by Ediff internally."
   :type 'string
   :group 'ediff-diff)
 (defcustom ediff-custom-diff-options "-c"
-  "*Options to pass to `ediff-custom-diff-program'."
+  "Options to pass to `ediff-custom-diff-program'."
   :type 'string
   :group 'ediff-diff)
 
@@ -136,7 +135,7 @@ This output is not used by Ediff internally."
 (defvar ediff-match-diff3-line "^====\\(.?\\)\C-m?$"
   "Pattern to match lines produced by diff3 that describe differences.")
 (defcustom ediff-diff3-options ""
-  "*Options to pass to `ediff-diff3-program'."
+  "Options to pass to `ediff-diff3-program'."
   :set 'ediff-set-diff-options
   :type 'string
   :group 'ediff-diff)
@@ -146,7 +145,7 @@ This output is not used by Ediff internally."
 
 (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'.
+  "Regexp that matches normal output lines from `ediff-diff3-program'.
 Lines that do not match are assumed to be error messages."
   :type 'regexp
   :group 'ediff-diff)
@@ -336,9 +335,7 @@ one optional arguments, diff-number to refine.")
     (erase-buffer)
     (insert (ediff-with-current-buffer diff-buff (buffer-string)))
     (goto-char (point-min))
-    (delete-matching-lines ok-regexp)
-    (if (memq system-type '(vax-vms axp-vms))
-       (delete-matching-lines "^$")))
+    (delete-matching-lines ok-regexp))
   ;; If diff reports errors, show them then quit.
   (if (/= 0 (ediff-with-current-buffer ediff-error-buffer (buffer-size)))
       (let ((ctl-buf ediff-control-buffer)
@@ -1210,7 +1207,13 @@ delimiter regions"))
 ;; args.
 (defun ediff-exec-process (program buffer synch options &rest files)
   (let ((data (match-data))
-       (coding-system-for-read ediff-coding-system-for-read)
+       ;; If this is a buffer job, we are diffing temporary files
+       ;; produced by Emacs with ediff-coding-system-for-write, so
+       ;; use the same encoding to read the results.
+       (coding-system-for-read
+        (if (string-match "buffer" (symbol-name ediff-job-name))
+            ediff-coding-system-for-write
+          ediff-coding-system-for-read))
        args)
     (setq args (append (split-string options) files))
     (setq args (delete "" (delq nil args))) ; delete nil and "" from arguments
@@ -1526,11 +1529,11 @@ affects only files whose names match the expression."
 
 
 
-;;; Local Variables:
-;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
-;;; End:
+;; Local Variables:
+;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
+;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
+;; End:
 
 ;; arch-tag: a86d448e-58d7-4572-a1d9-fdedfa22f648
 ;;; ediff-diff.el ends here