diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 7f329f91e4f..f966190ea6d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -6911,6 +6911,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)))) @@ -6955,7 +6961,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)