emacs-diffs
[Top][All Lists]
Advanced

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

master c9c8d98 1/4: Make ediff offer to create files it's inferring


From: Lars Ingebrigtsen
Subject: master c9c8d98 1/4: Make ediff offer to create files it's inferring
Date: Wed, 9 Dec 2020 08:52:59 -0500 (EST)

branch: master
commit c9c8d98446f7cd4c9e0eb7394c7f9039965932c7
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make ediff offer to create files it's inferring
    
    * lisp/vc/ediff-ptch.el (ediff-fixup-patch-map): Offer to create
    the inferred file name (if it doesn't exist) (bug#8009).  This allows
    applying a patch that creates a file.
---
 lisp/vc/ediff-ptch.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el
index 08640fc..580d488 100644
--- a/lisp/vc/ediff-ptch.el
+++ b/lisp/vc/ediff-ptch.el
@@ -465,6 +465,9 @@ 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"))
+                  (when (and (string= file1 file2)
+                             (y-or-n-p (format "Create %s?" file1)))
+                    (write-region (point-min) (point-min) file1))
                  (let ((directory t)
                        target)
                    (while directory



reply via email to

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