aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina2012-05-17 00:03:36 -0300
committerFabián Ezequiel Gallina2012-05-17 00:03:36 -0300
commit394f09a38f7cdb3138ed3dc778b702ab4ab3a2ba (patch)
treeb657f1ed414467e6496d25fcd109fa90a737aa0b
parentcd1ed6c8f4a50c0bc499bdcf78bbd4e39bdfc4d2 (diff)
downloademacs-394f09a38f7cdb3138ed3dc778b702ab4ab3a2ba.tar.gz
emacs-394f09a38f7cdb3138ed3dc778b702ab4ab3a2ba.zip
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.
-rw-r--r--lisp/progmodes/python.el8
1 files 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."
1726 (buffer-substring (point-at-bol) (point)) nil nil)) 1726 (buffer-substring (point-at-bol) (point)) nil nil))
1727 (input (substring-no-properties 1727 (input (substring-no-properties
1728 (or (comint-word (current-word)) "") nil nil)) 1728 (or (comint-word (current-word)) "") nil nil))
1729 (prompt (buffer-substring-no-properties 1729 (prompt
1730 (overlay-start comint-last-prompt-overlay) 1730 (with-current-buffer (process-buffer process)
1731 (overlay-end comint-last-prompt-overlay))) 1731 (buffer-substring-no-properties
1732 (overlay-start comint-last-prompt-overlay)
1733 (overlay-end comint-last-prompt-overlay))))
1732 (completion-code 1734 (completion-code
1733 (cond ((and (> (length python-shell-completion-pdb-string-code) 0) 1735 (cond ((and (> (length python-shell-completion-pdb-string-code) 0)
1734 (string-match 1736 (string-match