From: Tino Calancha Date: Thu, 8 Dec 2016 02:32:02 +0000 (+0900) Subject: ediff-fixup-patch-map: Improve prompt X-Git-Tag: emacs-26.0.90~1155 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2766c607b0b0d201be5b9b1d5eb291415e5980d8;p=emacs.git ediff-fixup-patch-map: Improve prompt * lisp/vc/ediff-ptch.el (ediff-fixup-patch-map): Make clear in the prompt when we are applying a multi patch. --- diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index 6e8e9473fcc..3effd9b2cf9 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -269,6 +269,7 @@ program." ;; directory part of filename (file-name-as-directory filename) (file-name-directory filename))) + (multi-patch-p (cdr ediff-patch-map)) ;; In case 2 files are possible patch targets, the user will be offered ;; to choose file1 or file2. In a multifile patch, if the user chooses ;; 1 or 2, this choice is preserved to decide future alternatives. @@ -430,6 +431,16 @@ Please advise: (f2-exists (setcar session-file-object file2)) (f1-exists (setcar session-file-object file1)) (t + ;; TODO: Often for multipaches the file doesn't exist because the + ;; directory part is wrong; for instance, if the patch need to + ;; be applied into + ;; (expand-file-name "lisp/vc/ediff-ptch.el" source-directory) + ;; and default-directory is + ;; (expand-file-name "lisp" source-directory) + ;; then Ediff assumes the wrong file: + ;; (expand-file-name "lisp/ediff-ptch.el" source-directory). + ;; We might identify these common failoures and suggest + ;; in the prompt the possible corrected file. --Tino (with-output-to-temp-buffer ediff-msg-buffer (ediff-with-current-buffer standard-output (fundamental-mode)) @@ -437,13 +448,15 @@ Please advise: (if (string= file1 file2) (princ (format " %s -is assumed to be the target for this patch. However, this file does not exist." - file1)) +is assumed to be %s target for this %spatch. However, this file does not exist." + file1 + (if multi-patch-p "one" "the") + (if multi-patch-p "multi-" ""))) (princ (format " %s %s -are two possible targets for this patch. However, these files do not exist." - file1 file2))) +are two possible targets for this %spatch. However, these files do not exist." + file1 file2 (if multi-patch-p "multi-" "")))) (princ " \nPlease enter an alternative patch target ...\n")) (let ((directory t)