]> git.eshelyaron.com Git - emacs.git/commitdiff
(python-use-skeletons): Re-add.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 12 Feb 2009 18:16:26 +0000 (18:16 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 12 Feb 2009 18:16:26 +0000 (18:16 +0000)
(def-python-skeleton): Use it.

lisp/ChangeLog
lisp/progmodes/python.el

index 8adb55338ed3577a85f7cb5cfec28e613be8ff31..041c0dd59eabf69fbd3ec7de88bfcc4cddfe7f95 100644 (file)
@@ -1,5 +1,8 @@
 2009-02-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * progmodes/python.el (python-use-skeletons): Re-add.
+       (def-python-skeleton): Use it.
+
        * international/quail.el (quail-make-guidance-frame): Remove the
        `parent-id' parameter.
        (quail-show-guidance): Make the new window dedicated.
index d848769f8b0d0a5bab1bd17c066d726848b754e1..cacd56b6639e64104fa04d4c69a15f20da3409ed 100644 (file)
@@ -2205,6 +2205,13 @@ Interactively, prompt for name."
 \f
 ;;;; Skeletons
 
+(defcustom python-use-skeletons nil
+  "Non-nil means template skeletons will be automagically inserted.
+This happens when pressing \"if<SPACE>\", for example, to prompt for
+the if condition."
+  :type 'boolean
+  :group 'python)
+
 (define-abbrev-table 'python-mode-abbrev-table ()
   "Abbrev table for Python mode."
   :case-fixed t
@@ -2221,9 +2228,10 @@ Interactively, prompt for name."
     `(progn
        ;; Usual technique for inserting a skeleton, but expand
        ;; to the original abbrev instead if in a comment or string.
-       (define-abbrev python-mode-abbrev-table ,name ""
-        ',function
-        nil t)                         ; system abbrev
+       (when python-use-skeletons
+         (define-abbrev python-mode-abbrev-table ,name ""
+           ',function
+           nil t))                      ; system abbrev
        (define-skeleton ,function
         ,(format "Insert Python \"%s\" template." name)
         ,@elements)))))