* progmodes/python.el (python-shell-completion-get-completions):
authorFabián Ezequiel Gallina <fgallina@gnu.org>
Mon, 2 Sep 2013 03:21:13 +0000 (00:21 -0300)
committerFabián Ezequiel Gallina <fgallina@gnu.org>
Mon, 2 Sep 2013 03:21:13 +0000 (00:21 -0300)
Drop use of deleted `comint-last-prompt-overlay'.

lisp/ChangeLog
lisp/progmodes/python.el

index be8caf1..b48ff2f 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-02  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * progmodes/python.el (python-shell-completion-get-completions):
+       Drop use of deleted `comint-last-prompt-overlay'.
+
 2013-09-01  Glenn Morris  <rgm@gnu.org>
 
        * Makefile.in (setwins, setwins_almost, setwins_for_subdirs):
index 7004836..b8e2f4c 100644 (file)
@@ -2266,13 +2266,17 @@ and use the following as the value of this variable:
 LINE is used to detect the context on how to complete given
 INPUT."
   (let* ((prompt
-          ;; Get the last prompt for the inferior process
-          ;; buffer. This is used for the completion code selection
-          ;; heuristic.
+          ;; Get last prompt of the inferior process buffer (this
+          ;; intentionally avoids using `comint-last-prompt' because
+          ;; of incompatibilities with Emacs 24.x).
           (with-current-buffer (process-buffer process)
-            (buffer-substring-no-properties
-             (overlay-start comint-last-prompt-overlay)
-             (overlay-end comint-last-prompt-overlay))))
+            (save-excursion
+              (buffer-substring-no-properties
+               (- (point) (length line))
+               (progn
+                 (re-search-backward "^")
+                 (python-util-forward-comment)
+                 (point))))))
          (completion-context
           ;; Check whether a prompt matches a pdb string, an import
           ;; statement or just the standard prompt and use the