summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina <galli.87@gmail.com>2014-11-16 11:20:25 -0300
committerFabián Ezequiel Gallina <galli.87@gmail.com>2014-11-16 11:20:25 -0300
commit651ebee618d9ee31b5a6035cbb06d575a626a42c (patch)
tree44a3c0d7f5b4249e783b8bde243d565a39d1cbcd /lisp
parent48b2b327831d2f71b02f2f16096765e2cad1d4c5 (diff)
downloademacs-651ebee618d9ee31b5a6035cbb06d575a626a42c.tar.gz
emacs-651ebee618d9ee31b5a6035cbb06d575a626a42c.tar.bz2
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')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/python.el14
2 files changed, 13 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0753c406110..129859c42e1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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>
Add faces for the VC modeline state indicator.
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."
proc-buffer-name)))
;;;###autoload
-(defun run-python (cmd &optional dedicated show)
+(defun run-python (&optional cmd dedicated show)
"Run an inferior Python process.
Input and output via buffer named after
`python-shell-buffer-name'. If there is a process already
running in that buffer, just switch to it.
-With argument, allows you to define CMD so you can edit the
-command used to call the interpreter and define DEDICATED, so a
-dedicated process for the current buffer is open. When numeric
-prefix arg is other than 0 or 4 do not SHOW.
+Argument CMD defaults to `python-shell-calculate-command' return
+value. When called interactively with `prefix-arg', it allows
+the user to edit such value and choose whether the interpreter
+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
`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))
(list (python-shell-calculate-command) nil t)))
(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)
(defun run-python-internal ()