1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 06:20:43 -08:00

Merge from origin/emacs-30

af8017b23f Explicitly document read-string return value
cf03c2b609 Improve docstrings of python.el import management
01bcc6961a ; Improve doc strings of Speedbar
bd9c76ab17 Avoid warnings about 'image-scaling-factor' in builds --w...
This commit is contained in:
Eli Zaretskii 2025-03-09 07:33:13 -04:00
commit bcfa9692f0
4 changed files with 80 additions and 55 deletions

View file

@ -6941,6 +6941,12 @@ argument, restrict the suggestions to imports defining the symbol
at point. If there is only one such suggestion, act without
asking.
If the buffer does not belong to a project, the import statement is
searched under the buffer's default directory. For example, if the file
is located directly under the home directory, all files under the home
directory will be searched. Please note that this can take a long time
and may appear to hang.
When calling from Lisp, use a non-nil NAME to restrict the
suggestions to imports defining NAME."
(interactive (list (when current-prefix-arg (thing-at-point 'symbol))))
@ -6985,7 +6991,17 @@ asking."
;;;###autoload
(defun python-fix-imports ()
"Add missing imports and remove unused ones from the current buffer."
"Add missing imports and remove unused ones from the current buffer.
If there are missing imports, ask for an import statement using all
imports found in the current project as suggestions. If there is only
one such suggestion, act without asking.
If the buffer does not belong to a project, the import statement is
searched under the buffer's default directory. For example, if the file
is located directly under the home directory, all files under the home
directory will be searched. Please note that this can take a long time
and may appear to hang."
(interactive)
(let ((buffer (current-buffer))
undefined unused add remove)