Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
c77f4a90
Commit
c77f4a90
authored
Jun 11, 2014
by
Matthias Meulien
Committed by
Stefan Monnier
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* lisp/progmodes/python.el (import skeleton): New skeleton.
(python-mode-map): Bind it. Fixes: debbugs:17672
parent
7c35a922
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
lisp/ChangeLog
lisp/ChangeLog
+3
-0
lisp/progmodes/python.el
lisp/progmodes/python.el
+11
-6
No files found.
lisp/ChangeLog
View file @
c77f4a90
...
...
@@ -6,6 +6,9 @@
2014-06-12 Matthias Meulien <orontee@gmail.com>
* progmodes/python.el (import skeleton): New skeleton (bug#17672).
(python-mode-map): Bind it.
* progmodes/python.el (class skeleton): Don't erase last char of class
name (bug#17683).
...
...
lisp/progmodes/python.el
View file @
c77f4a90
...
...
@@ -155,15 +155,13 @@
;; the shell completion in background so you should run
;; `python-shell-send-buffer' from time to time to get better results.
;; Skeletons:
6
skeletons are provided for simple inserting of class,
;; def, for, if, try and while. These skeletons are
integrated with
;; abbrev. If you have `abbrev-mode' activated and
;; Skeletons: skeletons are provided for simple inserting of
things like
class,
;; def, for,
import,
if, try
,
and while. These skeletons are
;;
integrated with
abbrev. If you have `abbrev-mode' activated and
;; `python-skeleton-autoinsert' is set to t, then whenever you type
;; the name of any of those defined and hit SPC, they will be
;; automatically expanded. As an alternative you can use the defined
;; skeleton commands: `python-skeleton-class', `python-skeleton-def'
;; `python-skeleton-for', `python-skeleton-if', `python-skeleton-try'
;; and `python-skeleton-while'.
;; skeleton commands: `python-skeleton-<foo>'.
;; FFAP: You can find the filename for a given module when using ffap
;; out of the box. This feature needs an inferior python shell
...
...
@@ -253,6 +251,7 @@
(
define-key
map
"\C-c\C-td"
'python-skeleton-def
)
(
define-key
map
"\C-c\C-tf"
'python-skeleton-for
)
(
define-key
map
"\C-c\C-ti"
'python-skeleton-if
)
(
define-key
map
"\C-c\C-tm"
'python-skeleton-import
)
(
define-key
map
"\C-c\C-tt"
'python-skeleton-try
)
(
define-key
map
"\C-c\C-tw"
'python-skeleton-while
)
;; Shell interaction
...
...
@@ -2957,6 +2956,12 @@ The skeleton will be bound to python-skeleton-NAME."
>
_
\n
'
(
python-skeleton--else
)
| ^)
(python-skeleton-define import nil
"Import from module: "
"from " str & " " |
-5
"import "
(
"Identifier: "
str
", "
)
-2
\n
_
)
(
python-skeleton-define
try
nil
nil
"try:"
\n
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment