It doesn't help much but allows to run python process, otherwise
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 25 Oct 2017 23:57:43 +0300
changeset 1545 d77b6bb30ea4
parent 1544 2e84ca7e2578
child 1546 4939c41ef080
It doesn't help much but allows to run python process, otherwise python-shell-calculate-command surrounds executable with quotes that damage program name.
.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.