diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 3a913a31193..91a85526420 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -155,15 +155,13 @@ | |||
| 155 | ;; the shell completion in background so you should run | 155 | ;; the shell completion in background so you should run |
| 156 | ;; `python-shell-send-buffer' from time to time to get better results. | 156 | ;; `python-shell-send-buffer' from time to time to get better results. |
| 157 | 157 | ||
| 158 | ;; Skeletons: 6 skeletons are provided for simple inserting of class, | 158 | ;; Skeletons: skeletons are provided for simple inserting of things like class, |
| 159 | ;; def, for, if, try and while. These skeletons are integrated with | 159 | ;; def, for, import, if, try, and while. These skeletons are |
| 160 | ;; abbrev. If you have `abbrev-mode' activated and | 160 | ;; integrated with abbrev. If you have `abbrev-mode' activated and |
| 161 | ;; `python-skeleton-autoinsert' is set to t, then whenever you type | 161 | ;; `python-skeleton-autoinsert' is set to t, then whenever you type |
| 162 | ;; the name of any of those defined and hit SPC, they will be | 162 | ;; the name of any of those defined and hit SPC, they will be |
| 163 | ;; automatically expanded. As an alternative you can use the defined | 163 | ;; automatically expanded. As an alternative you can use the defined |
| 164 | ;; skeleton commands: `python-skeleton-class', `python-skeleton-def' | 164 | ;; skeleton commands: `python-skeleton-<foo>'. |
| 165 | ;; `python-skeleton-for', `python-skeleton-if', `python-skeleton-try' | ||
| 166 | ;; and `python-skeleton-while'. | ||
| 167 | 165 | ||
| 168 | ;; FFAP: You can find the filename for a given module when using ffap | 166 | ;; FFAP: You can find the filename for a given module when using ffap |
| 169 | ;; out of the box. This feature needs an inferior python shell | 167 | ;; out of the box. This feature needs an inferior python shell |
| @@ -253,6 +251,7 @@ | |||
| 253 | (define-key map "\C-c\C-td" 'python-skeleton-def) | 251 | (define-key map "\C-c\C-td" 'python-skeleton-def) |
| 254 | (define-key map "\C-c\C-tf" 'python-skeleton-for) | 252 | (define-key map "\C-c\C-tf" 'python-skeleton-for) |
| 255 | (define-key map "\C-c\C-ti" 'python-skeleton-if) | 253 | (define-key map "\C-c\C-ti" 'python-skeleton-if) |
| 254 | (define-key map "\C-c\C-tm" 'python-skeleton-import) | ||
| 256 | (define-key map "\C-c\C-tt" 'python-skeleton-try) | 255 | (define-key map "\C-c\C-tt" 'python-skeleton-try) |
| 257 | (define-key map "\C-c\C-tw" 'python-skeleton-while) | 256 | (define-key map "\C-c\C-tw" 'python-skeleton-while) |
| 258 | ;; Shell interaction | 257 | ;; Shell interaction |
| @@ -2957,6 +2956,12 @@ The skeleton will be bound to python-skeleton-NAME." | |||
| 2957 | > _ \n | 2956 | > _ \n |
| 2958 | '(python-skeleton--else) | ^) | 2957 | '(python-skeleton--else) | ^) |
| 2959 | 2958 | ||
| 2959 | (python-skeleton-define import nil | ||
| 2960 | "Import from module: " | ||
| 2961 | "from " str & " " | -5 | ||
| 2962 | "import " | ||
| 2963 | ("Identifier: " str ", ") -2 \n _) | ||
| 2964 | |||
| 2960 | (python-skeleton-define try nil | 2965 | (python-skeleton-define try nil |
| 2961 | nil | 2966 | nil |
| 2962 | "try:" \n | 2967 | "try:" \n |