]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `python-shell-completion--do-completion-at-point' work for calls done via `pytho...
authorFabián Ezequiel Gallina <fgallina@cuca>
Thu, 17 May 2012 03:03:36 +0000 (00:03 -0300)
committerFabián Ezequiel Gallina <fgallina@gnu.org>
Thu, 17 May 2012 03:03:36 +0000 (00:03 -0300)
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

index 7f4aa940d8d10198b96e1853a7227bebf50ef105..cfc15c7d040ee1e6dc39ee55726759813ccdbf06 100644 (file)
@@ -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