aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTino Calancha2016-12-08 11:32:02 +0900
committerTino Calancha2016-12-08 11:32:02 +0900
commit2766c607b0b0d201be5b9b1d5eb291415e5980d8 (patch)
treea5a5cb09aa02053e476a56678584f2061392d871
parenta6776f0823b5dcc561c1074fab1d33fb779db250 (diff)
downloademacs-2766c607b0b0d201be5b9b1d5eb291415e5980d8.tar.gz
emacs-2766c607b0b0d201be5b9b1d5eb291415e5980d8.zip
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.
-rw-r--r--lisp/vc/ediff-ptch.el21
1 files changed, 17 insertions, 4 deletions
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."
269 ;; directory part of filename 269 ;; directory part of filename
270 (file-name-as-directory filename) 270 (file-name-as-directory filename)
271 (file-name-directory filename))) 271 (file-name-directory filename)))
272 (multi-patch-p (cdr ediff-patch-map))
272 ;; In case 2 files are possible patch targets, the user will be offered 273 ;; In case 2 files are possible patch targets, the user will be offered
273 ;; to choose file1 or file2. In a multifile patch, if the user chooses 274 ;; to choose file1 or file2. In a multifile patch, if the user chooses
274 ;; 1 or 2, this choice is preserved to decide future alternatives. 275 ;; 1 or 2, this choice is preserved to decide future alternatives.
@@ -430,6 +431,16 @@ Please advise:
430 (f2-exists (setcar session-file-object file2)) 431 (f2-exists (setcar session-file-object file2))
431 (f1-exists (setcar session-file-object file1)) 432 (f1-exists (setcar session-file-object file1))
432 (t 433 (t
434 ;; TODO: Often for multipaches the file doesn't exist because the
435 ;; directory part is wrong; for instance, if the patch need to
436 ;; be applied into
437 ;; (expand-file-name "lisp/vc/ediff-ptch.el" source-directory)
438 ;; and default-directory is
439 ;; (expand-file-name "lisp" source-directory)
440 ;; then Ediff assumes the wrong file:
441 ;; (expand-file-name "lisp/ediff-ptch.el" source-directory).
442 ;; We might identify these common failoures and suggest
443 ;; in the prompt the possible corrected file. --Tino
433 (with-output-to-temp-buffer ediff-msg-buffer 444 (with-output-to-temp-buffer ediff-msg-buffer
434 (ediff-with-current-buffer standard-output 445 (ediff-with-current-buffer standard-output
435 (fundamental-mode)) 446 (fundamental-mode))
@@ -437,13 +448,15 @@ Please advise:
437 (if (string= file1 file2) 448 (if (string= file1 file2)
438 (princ (format " 449 (princ (format "
439 %s 450 %s
440is assumed to be the target for this patch. However, this file does not exist." 451is assumed to be %s target for this %spatch. However, this file does not exist."
441 file1)) 452 file1
453 (if multi-patch-p "one" "the")
454 (if multi-patch-p "multi-" "")))
442 (princ (format " 455 (princ (format "
443 %s 456 %s
444 %s 457 %s
445are two possible targets for this patch. However, these files do not exist." 458are two possible targets for this %spatch. However, these files do not exist."
446 file1 file2))) 459 file1 file2 (if multi-patch-p "multi-" ""))))
447 (princ " 460 (princ "
448\nPlease enter an alternative patch target ...\n")) 461\nPlease enter an alternative patch target ...\n"))
449 (let ((directory t) 462 (let ((directory t)