summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina <fgallina@gnu.org>2013-09-02 00:21:13 -0300
committerFabián Ezequiel Gallina <fgallina@gnu.org>2013-09-02 00:21:13 -0300
commitcd16c5f1f5db8cfc6895288889fd9f5b376bfc41 (patch)
treea6d20c2f61420803dc2431085cea2e3857341397 /lisp
parenta892a94c4271d1d057ae65a1c63441c9eb0a2e5a (diff)
downloademacs-cd16c5f1f5db8cfc6895288889fd9f5b376bfc41.tar.gz
emacs-cd16c5f1f5db8cfc6895288889fd9f5b376bfc41.tar.bz2
emacs-cd16c5f1f5db8cfc6895288889fd9f5b376bfc41.zip
* progmodes/python.el (python-shell-completion-get-completions):
Drop use of deleted `comint-last-prompt-overlay'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/python.el16
2 files changed, 15 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index be8caf189d2..b48ff2f5030 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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):
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 7004836e69f..b8e2f4c8de9 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -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