diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 11195894234..cec0d54a447 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -4375,7 +4375,9 @@ For this to work as best as possible you should call | |||
| 4375 | `python-shell-send-buffer' from time to time so context in | 4375 | `python-shell-send-buffer' from time to time so context in |
| 4376 | inferior Python process is updated properly." | 4376 | inferior Python process is updated properly." |
| 4377 | (let ((process (python-shell-get-process))) | 4377 | (let ((process (python-shell-get-process))) |
| 4378 | (when process | 4378 | (when (and process |
| 4379 | (python-shell-with-shell-buffer | ||
| 4380 | (python-util-comint-end-of-output-p))) | ||
| 4379 | (python-shell-completion-at-point process)))) | 4381 | (python-shell-completion-at-point process)))) |
| 4380 | 4382 | ||
| 4381 | (define-obsolete-function-alias | 4383 | (define-obsolete-function-alias |
| @@ -4800,6 +4802,8 @@ def __FFAP_get_module_path(objstr): | |||
| 4800 | (defun python-ffap-module-path (module) | 4802 | (defun python-ffap-module-path (module) |
| 4801 | "Function for `ffap-alist' to return path for MODULE." | 4803 | "Function for `ffap-alist' to return path for MODULE." |
| 4802 | (when-let ((process (python-shell-get-process)) | 4804 | (when-let ((process (python-shell-get-process)) |
| 4805 | (ready (python-shell-with-shell-buffer | ||
| 4806 | (python-util-comint-end-of-output-p))) | ||
| 4803 | (module-file | 4807 | (module-file |
| 4804 | (python-shell-send-string-no-output | 4808 | (python-shell-send-string-no-output |
| 4805 | (format "%s\nprint(__FFAP_get_module_path(%s))" | 4809 | (format "%s\nprint(__FFAP_get_module_path(%s))" |
| @@ -4918,7 +4922,9 @@ If not FORCE-INPUT is passed then what `python-eldoc--get-symbol-at-point' | |||
| 4918 | returns will be used. If not FORCE-PROCESS is passed what | 4922 | returns will be used. If not FORCE-PROCESS is passed what |
| 4919 | `python-shell-get-process' returns is used." | 4923 | `python-shell-get-process' returns is used." |
| 4920 | (let ((process (or force-process (python-shell-get-process)))) | 4924 | (let ((process (or force-process (python-shell-get-process)))) |
| 4921 | (when process | 4925 | (when (and process |
| 4926 | (python-shell-with-shell-buffer | ||
| 4927 | (python-util-comint-end-of-output-p))) | ||
| 4922 | (let* ((input (or force-input | 4928 | (let* ((input (or force-input |
| 4923 | (python-eldoc--get-symbol-at-point))) | 4929 | (python-eldoc--get-symbol-at-point))) |
| 4924 | (docstring | 4930 | (docstring |
| @@ -5664,6 +5670,13 @@ This is for compatibility with Emacs < 24.4." | |||
| 5664 | comint-last-prompt) | 5670 | comint-last-prompt) |
| 5665 | (t nil))) | 5671 | (t nil))) |
| 5666 | 5672 | ||
| 5673 | (defun python-util-comint-end-of-output-p () | ||
| 5674 | "Return non-nil if the last prompt matches input prompt." | ||
| 5675 | (when-let ((prompt (python-util-comint-last-prompt))) | ||
| 5676 | (python-shell-comint-end-of-output-p | ||
| 5677 | (buffer-substring-no-properties | ||
| 5678 | (car prompt) (cdr prompt))))) | ||
| 5679 | |||
| 5667 | (defun python-util-forward-comment (&optional direction) | 5680 | (defun python-util-forward-comment (&optional direction) |
| 5668 | "Python mode specific version of `forward-comment'. | 5681 | "Python mode specific version of `forward-comment'. |
| 5669 | Optional argument DIRECTION defines the direction to move to." | 5682 | Optional argument DIRECTION defines the direction to move to." |