]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/python.el (import skeleton): New skeleton.
authorMatthias Meulien <orontee@gmail.com>
Thu, 12 Jun 2014 02:35:26 +0000 (22:35 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 12 Jun 2014 02:35:26 +0000 (22:35 -0400)
(python-mode-map): Bind it.

Fixes: debbugs:17672
lisp/ChangeLog
lisp/progmodes/python.el

index 618c05ee5effd919e7a5e52a2a8148f58f27460e..9d91fd3b2f30aa655a651d6e2479c37a20ebe7f0 100644 (file)
@@ -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).
 
index 3a913a31193a31edef0f818b45832b7eba3682bb..91a85526420163b2a7de2f95fa546c9c2f01b098 100644 (file)
 ;; 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
     (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