aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2009-02-12 18:16:26 +0000
committerStefan Monnier <[email protected]>2009-02-12 18:16:26 +0000
commit865ff911f332655d788f73f4f2ef534e0572cee0 (patch)
tree0c1d7e8399c18e0d4ac2331ac6dcfa88ad2a915a /lisp/progmodes/python.el
parentf58bd666fc080a6bbccf1a6a633fd6b547fbe936 (diff)
(python-use-skeletons): Re-add.
(def-python-skeleton): Use it.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index d848769f8b..cacd56b663 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2205,6 +2205,13 @@ Interactively, prompt for name."
;;;; 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)))))