> If I read the logs correctly, commands python-add-import, python-fix-imports, etc. will be introduced
> with Emacs 29. I am surprised there's no NEWS item related to those commands. Are the menu
> entries considered enough?
It's an omission. Feel free to write a NEWS entry and post it.
Here is a proposal:
diff --git a/etc/NEWS b/etc/NEWS
index 9e6f0c16bcd..f9621ef9164 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3056,6 +3056,12 @@ Without a prefix argument, the kind of shell (buffer-dedicated,
project-dedicated or global) is specified by the new
'python-shell-dedicated' user option.
+*** New commands to manage Python imports.
+'python-add-import', 'python-import-symbol-at-point',
+'python-remove-import', 'python-fix-imports', 'python-sort-imports'.
+The implementation relies on the Python library isort in version at
+least 5.7.0.
+
** Ruby Mode
---
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -6420,7 +6420,7 @@ python--list-imports
> (mapcar #'file-local-name source)))))
> lines)
> (unless (eq 0 status)
> - (error "%s exited with status %s (maybe isort is missing?)"
> + (error "%s exited with status %s (maybe isort>=5.7.0 is missing?)"
> python-interpreter status))
> (goto-char (point-min))
> (while (not (eobp))
> @@ -6465,7 +6465,7 @@ python--do-isort
> "-m" "isort" "-" args))
> (tick (buffer-chars-modified-tick)))
> (unless (eq 0 status)
> - (error "%s exited with status %s (maybe isort is missing?)"
> + (error "%s exited with status %s (maybe isort>=5.7.0 is missing?)"
Thanks, but the "isort>=5.7.0" part is quite cryptic. Can we do
better?
Yes, I'll work on it. I'll report a bug and send a patch there.