Mercurial > emacs
diff lisp/progmodes/python.el @ 101984:84b9607bddb0
(python-use-skeletons): Re-add.
(def-python-skeleton): Use it.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 12 Feb 2009 18:16:26 +0000 |
parents | fcd47e055a66 |
children | 603bb57bb542 |
line wrap: on
line diff
--- a/lisp/progmodes/python.el Thu Feb 12 18:13:20 2009 +0000 +++ b/lisp/progmodes/python.el Thu Feb 12 18:16:26 2009 +0000 @@ -2205,6 +2205,13 @@ ;;;; 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 @@ `(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)))))