summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-10-22 20:39:36 +0000
committerJohn Wiegley <johnw@newartisans.com>2006-10-22 20:39:36 +0000
commit7a338befad5fe10f592c0e432e7112dec8dd3d4c (patch)
tree0822ca2076b4835d5bc4ed5004dfdd47de46577f
parent2967b4c9d788a3b240bd90c4aa8f8f3ff48209e4 (diff)
downloademacs-7a338befad5fe10f592c0e432e7112dec8dd3d4c.tar.gz
2006-10-22 John Wiegley <johnw@newartisans.com>
* 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.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/progmodes/python.el10
2 files changed, 17 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 25ed1f27bd9..9712ccc2176 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2006-10-22 John Wiegley <johnw@newartisans.com>
+
+ * 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.
+
2006-10-22 Chong Yidong <cyd@stupidchicken.com>
* progmodes/cperl-mode.el (cperl-mode): Don't assume
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 0387c05134e..4d9a49a6b8d 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1969,6 +1969,13 @@ Repeating the command scrolls the completion window."
;;;; 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)
+
(defvar python-skeletons nil
"Alist of named skeletons for Python mode.
Elements are of the form (NAME . EXPANDER-FUNCTION).")
@@ -1986,7 +1993,8 @@ The default contents correspond to the elements of `python-skeletons'.")
(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)))))