aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el20
1 files changed, 12 insertions, 8 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 6ed912f8cfd..4ed24a4a4c6 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2866,11 +2866,11 @@ the full statement in the case of imports."
2866 "24.4" 2866 "24.4"
2867 "Completion string code must also autocomplete modules.") 2867 "Completion string code must also autocomplete modules.")
2868 2868
2869(defcustom python-shell-completion-pdb-string-code 2869(define-obsolete-variable-alias
2870 "';'.join(globals().keys() + locals().keys())" 2870 'python-shell-completion-pdb-string-code
2871 "Python code used to get completions separated by semicolons for [i]pdb." 2871 'python-shell-completion-string-code
2872 :type 'string 2872 "24.5"
2873 :group 'python) 2873 "Completion string code must work for (i)pdb.")
2874 2874
2875(defun python-shell-completion-get-completions (process import input) 2875(defun python-shell-completion-get-completions (process import input)
2876 "Do completion at point using PROCESS for IMPORT or INPUT. 2876 "Do completion at point using PROCESS for IMPORT or INPUT.
@@ -2885,10 +2885,14 @@ completion."
2885 ;; Check whether a prompt matches a pdb string, an import 2885 ;; Check whether a prompt matches a pdb string, an import
2886 ;; statement or just the standard prompt and use the 2886 ;; statement or just the standard prompt and use the
2887 ;; correct python-shell-completion-*-code string 2887 ;; correct python-shell-completion-*-code string
2888 (cond ((and (> (length python-shell-completion-pdb-string-code) 0) 2888 (cond ((and (string-match
2889 (string-match
2890 (concat "^" python-shell-prompt-pdb-regexp) prompt)) 2889 (concat "^" python-shell-prompt-pdb-regexp) prompt))
2891 python-shell-completion-pdb-string-code) 2890 ;; Since there are no guarantees the user will remain
2891 ;; in the same context where completion code was sent
2892 ;; (e.g. user steps into a function), safeguard
2893 ;; resending completion setup continuously.
2894 (concat python-shell-completion-setup-code
2895 "\nprint (" python-shell-completion-string-code ")"))
2892 ((string-match 2896 ((string-match
2893 python-shell--prompt-calculated-input-regexp prompt) 2897 python-shell--prompt-calculated-input-regexp prompt)
2894 python-shell-completion-string-code) 2898 python-shell-completion-string-code)