emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2766c60: ediff-fixup-patch-map: Improve prompt


From: Tino Calancha
Subject: [Emacs-diffs] master 2766c60: ediff-fixup-patch-map: Improve prompt
Date: Thu, 8 Dec 2016 02:32:51 +0000 (UTC)

branch: master
commit 2766c607b0b0d201be5b9b1d5eb291415e5980d8
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>

    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.
---
 lisp/vc/ediff-ptch.el |   21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el
index 6e8e947..3effd9b 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]