diff lisp/ediff-ptch.el @ 81331:c3779fe5830e

2007-06-12 Michael Kifer <kifer@cs.stonybrook.edu> * viper-cmd.el (viper-prefix-arg-com,viper-prefix-arg-value): display error messages (viper-prev-destructive-command,viper-insert-prev-from-insertion-ring): get rid of cl.el dependencies. * viper-init.el (viper-suppress-input-method-change-message): new variable. (viper-activate-input-method-action,viper-inactivate-input-method-action): use viper-suppress-input-method-change-message. * viper-kem.el (viper-vi-basic-map): disable the bindings for C-s, C-r. * viper-util.el (viper-set-cursor-color-according-to-state): use viper-replace-overlay-cursor-color instead of viper-replace-overlay-cursor-color. (viper-sit-for-short): use sit-for with 3 arguments. * viper.el (viper-insert-state-mode-list): add gud-mode. (viper-major-mode-modifier-list): add viper-comint-mode-modifier-map to gud-mode. * ediff-mult.el (ediff-meta-buffer-brief-message,ediff-meta-buffer-verbose-message): new variables. (ediff-meta-buffer-message): variable deleted. (ediff-verbose-help-enabled): new variable. (ediff-toggle-verbose-help-meta-buffer): new function. (ediff-redraw-directory-group-buffer): made aware of short/verbose message options * ediff-ptch.el (ediff-context-diff-label-regexp): better regexp. (ediff-fixup-patch-map): improved heuristic.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Tue, 12 Jun 2007 19:20:25 +0000
parents e3694f1cb928
children c5bcf5ad255f
line wrap: on
line diff
--- a/lisp/ediff-ptch.el	Tue Jun 12 18:52:05 2007 +0000
+++ b/lisp/ediff-ptch.el	Tue Jun 12 19:20:25 2007 +0000
@@ -136,10 +136,10 @@
 
 (defcustom ediff-context-diff-label-regexp
   (concat "\\(" 	; context diff 2-liner
-	  "^\\*\\*\\* \\([^ \t]+\\)[^*]+[\t ]*\n--- \\([^ \t]+\\)"
+	  "^\\*\\*\\* \\([^\t]+\\)[^*]+[\t ]*\n--- \\([^\t]+\\)"
 	  "\\|" 	; GNU unified format diff 2-liner
-	  "^--- \\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ \\([^ \t]+\\)"
-	  "\\)")
+	  "^--- \\([^\t]+\\)[\t ]+.*\n\\+\\+\\+ \\([^\t]+\\)"
+	  "\\)"))
   "*Regexp matching filename 2-liners at the start of each context diff.
 You probably don't want to change that, unless you are using an obscure patch
 program."
@@ -231,7 +231,7 @@
 	    ;; possible-file-names is holding the new file names until we
 	    ;; insert the old file name in the patch map
 	    ;; It is a pair
-	    ;;     (filename-from-1st-header-line . fn from 2nd line)
+	    ;;     (filename-from-1st-header-line . filename-from-2nd-line)
 	    (setq possible-file-names
 		  (cons (if (and beg1 end1)
 			    (buffer-substring beg1 end1)
@@ -309,12 +309,13 @@
 		;; 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 (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 ""))
+		(let ((default-directory (file-name-directory filename)))
+		  (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")
 		    (setcar proposed-file-names
 			    (ediff-file-name-sans-prefix