diff options
author | Juri Linkov <juri@linkov.net> | 2019-08-06 00:04:07 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2019-08-06 00:04:07 +0300 |
commit | bf276b792157023d2e469d6a32394cce9589e47e (patch) | |
tree | a64d7e2aceef4a73620c117aa30bf754f8149fe7 /lisp/dired-x.el | |
parent | f986269fe8e56210c0d1ca69fb5f4320e66e2736 (diff) | |
download | emacs-bf276b792157023d2e469d6a32394cce9589e47e.tar.gz |
* lisp/dired-x.el (dired-guess-shell-alist-default): Use git when possible.
Check for Git backend and provide "git apply" for patch files (bug#36895).
Diffstat (limited to 'lisp/dired-x.el')
-rw-r--r-- | lisp/dired-x.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 462fa4ee152..313a22725c7 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -827,6 +827,7 @@ Also useful for `auto-mode-alist' like this: ;; install GNU zip's version of zcat. (autoload 'Man-support-local-filenames "man") +(autoload 'vc-responsible-backend "vc") (defvar dired-guess-shell-alist-default (list @@ -909,7 +910,10 @@ Also useful for `auto-mode-alist' like this: '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") " " dired-guess-shell-znew-switches)) - '("\\.patch\\'" "cat * | patch") + (list "\\.patch\\'" + '(if (eq (ignore-errors (vc-responsible-backend default-directory)) 'Git) + "cat * | git apply" + "cat * | patch")) (list "\\.patch\\.g?z\\'" "gunzip -qc * | patch" ;; Optional decompression. '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) |