diff -r 2e84ca7e2578 -r d77b6bb30ea4 .emacs-my --- a/.emacs-my Mon Oct 23 14:20:14 2017 +0300 +++ b/.emacs-my Wed Oct 25 23:57:43 2017 +0300 @@ -554,6 +554,15 @@ path )) +(defun my-shell-quote-argument (arg) + (cond + ((string-match "[<>&|* \"()[]" arg) + (concat "'" arg "'")) + ((string-match "'" arg) + (concat "\"" arg "\"")) + (t + arg))) + ;; Activate Cygwin for native Windows Emacs if available. (when (eq system-type 'windows-nt) (ignore-errors @@ -562,8 +571,7 @@ (add-hook 'find-file-hook 'follow-cygwin-symlink) ;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument' ;; quoted by double '\' chars this cause failure. - (defun shell-quote-argument (argument) - (concat "'" argument "'")) + (advice-add #'shell-quote-argument :override #'my-shell-quote-argument) ;; Workaround for Cygwin when 'shell-file-name' is 'bash'. (setq null-device "/dev/null") ;; Use shell from Cygwin/MinGW.