File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -380,17 +380,13 @@ When a region is active, propose to use it as the patch buffer."
380
380
((length> results 1 ) (completing-read " Select a target directory: " results))
381
381
(t (read-directory-name " Cannot deduce the target directory, select one: " )))))
382
382
(when (y-or-n-p (format " Apply patch %S in directory %S ? " (file-name-nondirectory (buffer-file-name patch-buf)) target-dir))
383
- ; ; Add the `+apply-patch-dwim-extra-options' to `ediff-patch-options'
384
- (require 'ediff-ptch ) ; for `ediff-patch-options'
385
- (let ((ediff-patch-options (format " %s %s " ediff-patch-options +apply-patch-dwim-extra-options)))
386
- (run-hook-with-args '+apply-patch-dwim-pre-patch-functions patch-buf patch-files target-dir)
387
- ; ; Hackish way of forcing `ediff-patch-file' to use the `target-file-or-dir' without asking
388
- (cl-letf (((symbol-function 'read-file-name )
389
- (lambda (&rest args )
390
- (if (length= patch-files 2 )
391
- (expand-file-name (caar candidates) target-dir)
392
- target-dir))))
393
- (ediff-patch-file nil patch-buf))
383
+ (let ((default-directory target-dir)
384
+ (out-buf (get-buffer-create " *apply-patch-dwim*" ))
385
+ (patch-file (with-current-buffer patch-buf
386
+ (let ((temp-filename (make-temp-file " apply-patch-dwim-" nil " .patch" )))
387
+ (write-file temp-filename)
388
+ temp-filename))))
389
+ (shell-command (format " patch -p1 %s -i %S " +apply-patch-dwim-extra-options patch-file) out-buf out-buf)
394
390
(run-hook-with-args '+apply-patch-dwim-post-patch-functions patch-buf patch-files target-dir))))))))
395
391
396
392
;;;### autoload
You can’t perform that action at this time.
0 commit comments