diff lisp/ediff-ptch.el @ 65856:d64aeb0dc54e

2005-10-05 Michael Kifer <kifer@cs.stonybrook.edu> * ediff-merge.el (ediff-merge-region-is-non-clash): new defsubst. (ediff-merge-region-is-non-clash-to-skip): previouslu called ediff-merge-region-is-non-clash. * ediff-mult.el (ediff-append-custom-diff,ediff-meta-show-patch): use insert-buffer-substring. * ediff-ptch.el (ediff-fixup-patch-map): use better heuristics for selecting files to patch. Also bug fixes. * ediff-util.el (ediff-setup): bug fix. (ediff-next-difference): Never skip clashes that differ in white space only. * ediff-wind.el (ediff-setup-control-frame,ediff-destroy-control-frame): check the menubar feature. * viper-cmd.el (viper-normalize-minor-mode-map-alist, viper-refresh-mode-line): use make-local-variable to localize some vars instead of make-variable-buffer-local. Suggested by Stefan Monnier. * viper-init.el (viper-make-variable-buffer-local): delete alias. (viper-restore-cursor-type,viper-set-insert-cursor-type): use make-local-variable instead of make-variable-buffer-local. Suggested by Stefan Monnier. * viper.el (viper-mode): don't use viper-make-variable-buffer-local. (viper-comint-mode-hook): use make-local-variable on require-final-newline. (viper-non-hook-settings): don't use make-variable-buffer-local.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Thu, 06 Oct 2005 00:09:49 +0000
parents 87a76ede9b30
children 3bd95f4f2941 aa89c814f853
line wrap: on
line diff
--- a/lisp/ediff-ptch.el	Wed Oct 05 17:20:04 2005 +0000
+++ b/lisp/ediff-ptch.el	Thu Oct 06 00:09:49 2005 +0000
@@ -297,16 +297,23 @@
 		      ;; (file1 . file2). Get it using ediff-get-session-objA.
 		      (ediff-get-session-objA-name session-info))
 		     ;; base-dir1 is  the dir part of the 1st file in the patch
-		     (base-dir1 (file-name-directory (car proposed-file-names)))
+		     (base-dir1
+		      (or (file-name-directory (car proposed-file-names))
+			  ""))
 		     ;; directory part of the 2nd file in the patch
-		     (base-dir2 (file-name-directory (cdr proposed-file-names)))
+		     (base-dir2
+		      (or (file-name-directory (cdr proposed-file-names))
+			  ""))
 		     )
-		;; If both base-dir1 and base-dir2 are relative, assume that
+		;; If both base-dir1 and base-dir2 are relative and exist,
+		;; assume that
 		;; these dirs lead to the actual files starting at the present
 		;; directory. So, we don't strip these relative dirs from the
 		;; file names. This is a heuristic intended to improve guessing
-		(unless (or (and base-dir1 (file-name-absolute-p base-dir1))
-			    (and base-dir2 (file-name-absolute-p base-dir2)))
+		(unless (or (file-name-absolute-p base-dir1)
+			    (file-name-absolute-p base-dir2)
+			    (not (file-exists-p base-dir1))
+			    (not (file-exists-p base-dir2)))
 		  (setq base-dir1 ""
 			base-dir2 ""))
 		(or (string= (car proposed-file-names) "/dev/null")
@@ -377,8 +384,8 @@
 			   (concat actual-dir (cdr proposed-file-names)))))
 		))
 	    ediff-patch-map)
-    ;; check for the shorter existing file in each pair and discard the other
-    ;; one
+    ;; Check for the existing files in each pair and discard the nonexisting
+    ;; ones. If both exist, ask the user.
     (mapcar (lambda (session-info)
 	      (let* ((file1 (car (ediff-get-session-objA-name session-info)))
 		     (file2 (cdr (ediff-get-session-objA-name session-info)))