aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina2014-11-16 11:20:25 -0300
committerFabián Ezequiel Gallina2014-11-16 11:20:25 -0300
commit651ebee618d9ee31b5a6035cbb06d575a626a42c (patch)
tree44a3c0d7f5b4249e783b8bde243d565a39d1cbcd /lisp/progmodes/python.el
parent48b2b327831d2f71b02f2f16096765e2cad1d4c5 (diff)
downloademacs-651ebee618d9ee31b5a6035cbb06d575a626a42c.tar.gz
emacs-651ebee618d9ee31b5a6035cbb06d575a626a42c.zip
Fixes: debbugs:18596
* lisp/progmodes/python.el (run-python): Allow CMD to be optional and default it to a safe command, even for Windows. (bug#18596)
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index f8490254c79..d6c4199cc94 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2473,16 +2473,17 @@ killed."
2473 proc-buffer-name))) 2473 proc-buffer-name)))
2474 2474
2475;;;###autoload 2475;;;###autoload
2476(defun run-python (cmd &optional dedicated show) 2476(defun run-python (&optional cmd dedicated show)
2477 "Run an inferior Python process. 2477 "Run an inferior Python process.
2478Input and output via buffer named after 2478Input and output via buffer named after
2479`python-shell-buffer-name'. If there is a process already 2479`python-shell-buffer-name'. If there is a process already
2480running in that buffer, just switch to it. 2480running in that buffer, just switch to it.
2481 2481
2482With argument, allows you to define CMD so you can edit the 2482Argument CMD defaults to `python-shell-calculate-command' return
2483command used to call the interpreter and define DEDICATED, so a 2483value. When called interactively with `prefix-arg', it allows
2484dedicated process for the current buffer is open. When numeric 2484the user to edit such value and choose whether the interpreter
2485prefix arg is other than 0 or 4 do not SHOW. 2485should be DEDICATED for the current buffer. When numeric prefix
2486arg is other than 0 or 4 do not SHOW.
2486 2487
2487Runs the hook `inferior-python-mode-hook' after 2488Runs the hook `inferior-python-mode-hook' after
2488`comint-mode-hook' is run. (Type \\[describe-mode] in the 2489`comint-mode-hook' is run. (Type \\[describe-mode] in the
@@ -2495,7 +2496,8 @@ process buffer for a list of commands.)"
2495 (= (prefix-numeric-value current-prefix-arg) 4)) 2496 (= (prefix-numeric-value current-prefix-arg) 4))
2496 (list (python-shell-calculate-command) nil t))) 2497 (list (python-shell-calculate-command) nil t)))
2497 (python-shell-make-comint 2498 (python-shell-make-comint
2498 cmd (python-shell-get-process-name dedicated) show) 2499 (or cmd (python-shell-calculate-command))
2500 (python-shell-get-process-name dedicated) show)
2499 dedicated) 2501 dedicated)
2500 2502
2501(defun run-python-internal () 2503(defun run-python-internal ()