From 394f09a38f7cdb3138ed3dc778b702ab4ab3a2ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabi=C3=A1n=20Ezequiel=20Gallina?= Date: Thu, 17 May 2012 00:03:36 -0300 Subject: [PATCH] Make `python-shell-completion--do-completion-at-point' work for calls done via `python-completion-complete-at-point'. The comint prompt retrieval logic was failing on `python-shell-completion--do-completion-at-point' when calls to it happened from outside the process buffer. --- lisp/progmodes/python.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 7f4aa940d8d..cfc15c7d040 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1726,9 +1726,11 @@ completions on the current context." (buffer-substring (point-at-bol) (point)) nil nil)) (input (substring-no-properties (or (comint-word (current-word)) "") nil nil)) - (prompt (buffer-substring-no-properties - (overlay-start comint-last-prompt-overlay) - (overlay-end comint-last-prompt-overlay))) + (prompt + (with-current-buffer (process-buffer process) + (buffer-substring-no-properties + (overlay-start comint-last-prompt-overlay) + (overlay-end comint-last-prompt-overlay)))) (completion-code (cond ((and (> (length python-shell-completion-pdb-string-code) 0) (string-match -- 2.39.2