From: Fabián Ezequiel Gallina Date: Thu, 17 May 2012 03:03:36 +0000 (-0300) Subject: Make `python-shell-completion--do-completion-at-point' work for calls done via `pytho... X-Git-Tag: emacs-24.2.90~1199^2~506 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=394f09a38f7cdb3138ed3dc778b702ab4ab3a2ba;p=emacs.git 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. --- 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