Edit the introduction of the "Python programming" section

This commit is contained in:
Gerard Vermeulen 2025-01-28 18:19:25 +01:00
parent 742f5d6425
commit 387588296f

View File

@ -4500,29 +4500,26 @@ major mode is =go-ts-mode=.
:END:
The [[https://www.emacswiki.org/emacs/PythonProgrammingInEmacs][Python Programming in Emacs]] wiki page lists options to enhance Emacs's
built-in ~python-mode~. Here, the focus is on one Emacs package and three Python
packages:
1. [[#sec:eglot][Eglot - Emacs polyGLOT: a builtin LSP client since Emacs-29.1]] and its author
(who is a prolific Common Lisp and Emacs Lisp programmer) has also
contributed to other parts of Emacs.
2. [[https://jedi.readthedocs.io/en/latest/][Jedi]] is a static analysis tool for Python that is typically used in plugins
for editors or integrated development environments. Jedi has a focus on
autocompletion and object definition lookup functionality.
3. Nowadays, [[https://github.com/charliermarsh/ruff#readme][Ruff]] is the fastest Python linter and a replacement for [[https://flake8.pycqa.org/en/latest/][Flake8]] with
a variety of its plugins. [[https://notes.crmarsh.com/][Charlie Marsh]] explains why he started [[https://pypi.org/project/ruff/][Ruff]] in the
post [[https://notes.crmarsh.com/python-tooling-could-be-much-much-faster][Python tooling could be much faster]].
4. [[https://github.com/python-lsp/python-lsp-server#readme][Python LSP Server]] is in my opinion the most complete [[https://en.wikipedia.org/wiki/Language_Server_Protocol][Language Server Protocol]]
implementation for Python and it handles [[https://github.com/charliermarsh/ruff#readme][Ruff]] thanks to the [[https://github.com/python-lsp/python-lsp-ruff][python-lsp-ruff]]
plugin.
built-in ~python-mode~. Here, the focus is on one Emacs package and three
[[https://en.wikipedia.org/wiki/Language_Server_Protocol][Language Server Protocol]] servers for Python:
1. [[#sec:eglot][Eglot - Emacs polyGLOT]] which is a builtin [[https://en.wikipedia.org/wiki/Language_Server_Protocol][Language Server Protocol]] client
since Emacs-29.1.
2. [[https://docs.astral.sh/ruff/][Ruff]] is a [[https://en.wikipedia.org/wiki/Language_Server_Protocol][Language Server Protocol]] server with a fast Python linter that
replaces [[https://flake8.pycqa.org/en/latest/][Flake8]] and its plugins as well as a Python formatter that is
compatible with [[https://black.readthedocs.io/en/stable/][Black]].
3. [[https://github.com/python-lsp/python-lsp-server#readme][Python LSP Server]] which uses [[https://github.com/charliermarsh/ruff#readme][Ruff]] thanks to the [[https://github.com/python-lsp/python-lsp-ruff][python-lsp-ruff]] plugin.
4. [[https://docs.basedpyright.com/latest/][Basedpyright]] which handles typing better than [[https://docs.astral.sh/ruff/][Ruff]] and [[https://github.com/python-lsp/python-lsp-server#readme][Python LSP Server]].
Here are links covering how to integrate Emacs, Python and a Python LSP
server, before plunging into the configuration steps:
1. [[https://taingram.org/blog/emacs-lsp-ide.html][Building Your Own Emacs IDE with LSP]]
2. [[https://rgoswami.me/posts/emacs-lang-servers/][Doom Emacs and Language Servers]]
3. [[https://ddavis.io/posts/eglot-python-ide/][Eglot based Emacs Python IDE]]
4. [[https://www.mattduck.com/lsp-python-getting-started.html][Getting started with lsp-mode for Python]]
5. [[https://ddavis.io/posts/python-emacs-3/][Python & Emacs, Take 3]]
6. [[https://ddavis.io/posts/emacs-python-lsp/][Python with Emacs: py(v)env and lsp-mode]]
1. [[https://taingram.org/blog/emacs-lsp-ide.html][Building Your Own Emacs IDE with LSP]] which uses [[https://github.com/emacs-lsp/lsp-mode][lsp-mode]].
2. [[https://rgoswami.me/posts/emacs-lang-servers/][Doom Emacs and Language Servers]] which uses [[#sec:eglot][Eglot]] with [[https://github.com/python-lsp/python-lsp-server#readme][Python LSP Server]].
3. [[https://ddavis.io/blog/eglot-python-ide/][Eglot based Emacs Python IDE]] which is not up to date.
4. [[https://www.mattduck.com/lsp-python-getting-started.html][Getting started with lsp-mode for Python]] which is not up to date.
5. [[https://ddavis.io/blog/python-emacs-3/][Python & Emacs, Take 3]] which uses [[https://github.com/emacs-lsp/lsp-mode][lsp-mode]].
6. [[https://ddavis.io/posts/emacs-python-lsp/][Python with Emacs: py(v)env and lsp-mode]] which uses [[https://github.com/emacs-lsp/lsp-mode][lsp-mode]].
7. [[https://www.youtube.com/watch?v=K-GjbbcwLFc][Setting up Basedpyright LSP with Emacs Eglot]] which is a less interesting than
[[https://docs.basedpyright.com/latest/][Basedpyright]].
Here are links to Python programming background videos:
1. [[https://www.youtube.com/watch?v=T-TwcmT6Rcw][Dataclasses: The Code Generator to End All Code Generators - Raymond Hettinger]]