diff options
| author | Fabián Ezequiel Gallina | 2014-08-04 18:35:17 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2014-08-04 18:35:17 -0300 |
| commit | 5ea39c0613cb7100189a1bb5e79de26d4fe7e8d0 (patch) | |
| tree | 41518b8c4cb5c8b5dcf13eac77c99f85020a2831 | |
| parent | c7d117f39e26bb14a300f8ebdbc4c7023fad719b (diff) | |
| download | emacs-5ea39c0613cb7100189a1bb5e79de26d4fe7e8d0.tar.gz emacs-5ea39c0613cb7100189a1bb5e79de26d4fe7e8d0.zip | |
* lisp/progmodes/python.el: Fix completions inside (i)pdb.
(python-shell-completion-pdb-string-code): Make obsolete.
(python-shell-completion-get-completions): Use
python-shell-completion-string-code resending setup code
continuously for (i)pdb.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 20 |
2 files changed, 20 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9039e43b009..c9b888f3c34 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-08-04 Fabián Ezequiel Gallina <fgallina@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/python.el: Fix completions inside (i)pdb. | ||
| 4 | (python-shell-completion-pdb-string-code): Make obsolete. | ||
| 5 | (python-shell-completion-get-completions): Use | ||
| 6 | python-shell-completion-string-code resending setup code | ||
| 7 | continuously for (i)pdb. | ||
| 8 | |||
| 1 | 2014-08-04 Paul Eggert <eggert@cs.ucla.edu> | 9 | 2014-08-04 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 10 | ||
| 3 | * rect.el (rectangle--default-line-number-format): Rename | 11 | * rect.el (rectangle--default-line-number-format): Rename |
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) |