summaryrefslogtreecommitdiff
path: root/lisp/ediff-ptch.el
diff options
context:
space:
mode:
authorMichael Kifer <kifer@cs.stonybrook.edu>2005-10-06 00:09:49 +0000
committerMichael Kifer <kifer@cs.stonybrook.edu>2005-10-06 00:09:49 +0000
commite2de3a29450c31966bcb8336c1f52b2ad495298a (patch)
treeb0eabde48df09afaec7eb3f7ec30876c0711196b /lisp/ediff-ptch.el
parent20ef86730cca82a1a2e212a665c0b119ed2d70b2 (diff)
downloademacs-e2de3a29450c31966bcb8336c1f52b2ad495298a.tar.gz
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.
Diffstat (limited to 'lisp/ediff-ptch.el')
-rw-r--r--lisp/ediff-ptch.el21
1 files changed, 14 insertions, 7 deletions
diff --git a/lisp/ediff-ptch.el b/lisp/ediff-ptch.el
index 78bad19bab8..9379b6127a9 100644
--- a/lisp/ediff-ptch.el
+++ b/lisp/ediff-ptch.el
@@ -297,16 +297,23 @@ program."
;; (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 @@ other files, enter /dev/null
(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)))