# HG changeset patch # User John Wiegley # Date 1161549436 0 # Node ID 664e876d97fd968f7c9b68d2db912a89d73605cd # Parent 520f07d7cc57f97eea7fbd1b51560f4902395463 2006-10-22 John Wiegley * progmodes/python.el (python-use-skeletons): python-mode was auto-inserting templates (for those with abbrev-mode on), not only by default -- *but without a configuration variable to disable it*. This rendered python-mode completely useless for me, so I have added `python-use-skeletons', which is now off by default. diff -r 520f07d7cc57 -r 664e876d97fd lisp/progmodes/python.el --- a/lisp/progmodes/python.el Sun Oct 22 17:32:30 2006 +0000 +++ b/lisp/progmodes/python.el Sun Oct 22 20:37:16 2006 +0000 @@ -1969,6 +1969,13 @@ ;;;; Skeletons +(defcustom python-use-skeletons nil + "Non-nil means template skeletons will be automagically inserted. +This happens when pressing \"if\", for example, to prompt for +the if condition." + :type 'boolean + :group 'python) + (defvar python-skeletons nil "Alist of named skeletons for Python mode. Elements are of the form (NAME . EXPANDER-FUNCTION).") @@ -1986,7 +1993,8 @@ (function (intern (concat "python-insert-" name)))) `(progn (add-to-list 'python-skeletons ',(cons name function)) - (define-abbrev python-mode-abbrev-table ,name "" ',function nil t) + (if python-use-skeletons + (define-abbrev python-mode-abbrev-table ,name "" ',function nil t)) (define-skeleton ,function ,(format "Insert Python \"%s\" template." name) ,@elements)))))