aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorStefan Monnier2009-02-12 18:16:26 +0000
committerStefan Monnier2009-02-12 18:16:26 +0000
commit865ff911f332655d788f73f4f2ef534e0572cee0 (patch)
tree0c1d7e8399c18e0d4ac2331ac6dcfa88ad2a915a /lisp/progmodes/python.el
parentf58bd666fc080a6bbccf1a6a633fd6b547fbe936 (diff)
downloademacs-865ff911f332655d788f73f4f2ef534e0572cee0.tar.gz
emacs-865ff911f332655d788f73f4f2ef534e0572cee0.zip
(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 d848769f8b0..cacd56b6639 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2205,6 +2205,13 @@ Interactively, prompt for name."
2205 2205
2206;;;; Skeletons 2206;;;; Skeletons
2207 2207
2208(defcustom python-use-skeletons nil
2209 "Non-nil means template skeletons will be automagically inserted.
2210This happens when pressing \"if<SPACE>\", for example, to prompt for
2211the if condition."
2212 :type 'boolean
2213 :group 'python)
2214
2208(define-abbrev-table 'python-mode-abbrev-table () 2215(define-abbrev-table 'python-mode-abbrev-table ()
2209 "Abbrev table for Python mode." 2216 "Abbrev table for Python mode."
2210 :case-fixed t 2217 :case-fixed t
@@ -2221,9 +2228,10 @@ Interactively, prompt for name."
2221 `(progn 2228 `(progn
2222 ;; Usual technique for inserting a skeleton, but expand 2229 ;; Usual technique for inserting a skeleton, but expand
2223 ;; to the original abbrev instead if in a comment or string. 2230 ;; to the original abbrev instead if in a comment or string.
2224 (define-abbrev python-mode-abbrev-table ,name "" 2231 (when python-use-skeletons
2225 ',function 2232 (define-abbrev python-mode-abbrev-table ,name ""
2226 nil t) ; system abbrev 2233 ',function
2234 nil t)) ; system abbrev
2227 (define-skeleton ,function 2235 (define-skeleton ,function
2228 ,(format "Insert Python \"%s\" template." name) 2236 ,(format "Insert Python \"%s\" template." name)
2229 ,@elements))))) 2237 ,@elements)))))