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)
This commit is contained in:
Fabián Ezequiel Gallina 2014-11-16 11:20:25 -03:00
parent 48b2b32783
commit 651ebee618
2 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org>
* progmodes/python.el (run-python): Allow CMD to be optional and
default it to a safe command, even for Windows. (bug#18596)
2014-11-13 Oscar Fuentes <ofv@wanadoo.es> 2014-11-13 Oscar Fuentes <ofv@wanadoo.es>
Add faces for the VC modeline state indicator. Add faces for the VC modeline state indicator.

View file

@ -2473,16 +2473,17 @@ killed."
proc-buffer-name))) proc-buffer-name)))
;;;###autoload ;;;###autoload
(defun run-python (cmd &optional dedicated show) (defun run-python (&optional cmd dedicated show)
"Run an inferior Python process. "Run an inferior Python process.
Input and output via buffer named after Input and output via buffer named after
`python-shell-buffer-name'. If there is a process already `python-shell-buffer-name'. If there is a process already
running in that buffer, just switch to it. running in that buffer, just switch to it.
With argument, allows you to define CMD so you can edit the Argument CMD defaults to `python-shell-calculate-command' return
command used to call the interpreter and define DEDICATED, so a value. When called interactively with `prefix-arg', it allows
dedicated process for the current buffer is open. When numeric the user to edit such value and choose whether the interpreter
prefix arg is other than 0 or 4 do not SHOW. should be DEDICATED for the current buffer. When numeric prefix
arg is other than 0 or 4 do not SHOW.
Runs the hook `inferior-python-mode-hook' after Runs the hook `inferior-python-mode-hook' after
`comint-mode-hook' is run. (Type \\[describe-mode] in the `comint-mode-hook' is run. (Type \\[describe-mode] in the
@ -2495,7 +2496,8 @@ process buffer for a list of commands.)"
(= (prefix-numeric-value current-prefix-arg) 4)) (= (prefix-numeric-value current-prefix-arg) 4))
(list (python-shell-calculate-command) nil t))) (list (python-shell-calculate-command) nil t)))
(python-shell-make-comint (python-shell-make-comint
cmd (python-shell-get-process-name dedicated) show) (or cmd (python-shell-calculate-command))
(python-shell-get-process-name dedicated) show)
dedicated) dedicated)
(defun run-python-internal () (defun run-python-internal ()