diff options
| author | Stefan Kangas | 2024-09-29 23:29:54 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2024-09-29 23:39:54 +0200 |
| commit | dd4c67907eb3084c6f55828c51bca1675a98376d (patch) | |
| tree | 950772b6a0be54eb88793f5cb2aee427b0b27e32 /lisp/progmodes/python.el | |
| parent | 4003d5f12673d243d2cf5e36f6d124d166cc96be (diff) | |
| download | emacs-dd4c67907eb3084c6f55828c51bca1675a98376d.tar.gz emacs-dd4c67907eb3084c6f55828c51bca1675a98376d.zip | |
Try "python" before "python3" in python-mode
Prefer whatever version of Python that "python" might point to; use
"python3" if it doesn't exist. On recent versions of typical GNU/Linux
distributions, "python" either does not exist or it points to Python 3.
In (presumed rare) cases where "python" points to Python 2 instead,
users are now expected to manually customize these variables if they
want to use Python 3.
* lisp/progmodes/python.el (python-interpreter)
(python-shell-interpreter): Prefer "python" to "python3".
Ref:
https://lists.gnu.org/r/emacs-devel/2024-09/msg00885.html
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 39efeaf9122..d4a213466f3 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -313,8 +313,8 @@ | |||
| 313 | :link '(emacs-commentary-link "python")) | 313 | :link '(emacs-commentary-link "python")) |
| 314 | 314 | ||
| 315 | (defcustom python-interpreter | 315 | (defcustom python-interpreter |
| 316 | (cond ((executable-find "python3") "python3") | 316 | (cond ((executable-find "python") "python") |
| 317 | ((executable-find "python") "python") | 317 | ((executable-find "python3") "python3") |
| 318 | (t "python3")) | 318 | (t "python3")) |
| 319 | "Python interpreter for noninteractive use. | 319 | "Python interpreter for noninteractive use. |
| 320 | Some Python interpreters also require changes to | 320 | Some Python interpreters also require changes to |
| @@ -2739,8 +2739,8 @@ position, else returns nil." | |||
| 2739 | :safe 'stringp) | 2739 | :safe 'stringp) |
| 2740 | 2740 | ||
| 2741 | (defcustom python-shell-interpreter | 2741 | (defcustom python-shell-interpreter |
| 2742 | (cond ((executable-find "python3") "python3") | 2742 | (cond ((executable-find "python") "python") |
| 2743 | ((executable-find "python") "python") | 2743 | ((executable-find "python3") "python3") |
| 2744 | (t "python3")) | 2744 | (t "python3")) |
| 2745 | "Python interpreter for interactive use. | 2745 | "Python interpreter for interactive use. |
| 2746 | 2746 | ||
| @@ -2748,7 +2748,7 @@ Some Python interpreters also require changes to | |||
| 2748 | `python-shell-interpreter-args'. In particular, setting | 2748 | `python-shell-interpreter-args'. In particular, setting |
| 2749 | `python-shell-interpreter' to \"ipython3\" requires setting | 2749 | `python-shell-interpreter' to \"ipython3\" requires setting |
| 2750 | `python-shell-interpreter-args' to \"--simple-prompt\"." | 2750 | `python-shell-interpreter-args' to \"--simple-prompt\"." |
| 2751 | :version "28.1" | 2751 | :version "31.1" |
| 2752 | :type 'string) | 2752 | :type 'string) |
| 2753 | 2753 | ||
| 2754 | (defcustom python-shell-internal-buffer-name "Python Internal" | 2754 | (defcustom python-shell-internal-buffer-name "Python Internal" |