emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117319: * lisp/progmodes/python.el (import skeleton


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r117319: * lisp/progmodes/python.el (import skeleton): New skeleton.
Date: Thu, 12 Jun 2014 02:35:34 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117319
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17672
author: Matthias Meulien <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2014-06-11 22:35:26 -0400
message:
  * lisp/progmodes/python.el (import skeleton): New skeleton.
  (python-mode-map): Bind it.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/python.el       python.el-20091113204419-o5vbwnq5f7feedwu-3008
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-06-12 02:29:50 +0000
+++ b/lisp/ChangeLog    2014-06-12 02:35:26 +0000
@@ -6,6 +6,9 @@
 
 2014-06-12  Matthias Meulien  <address@hidden>
 
+       * 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).
 

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2014-06-12 02:24:24 +0000
+++ b/lisp/progmodes/python.el  2014-06-12 02:35:26 +0000
@@ -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 @@
   > _ \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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]