aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-02-12 18:16:26 +0000
committerStefan Monnier2009-02-12 18:16:26 +0000
commit865ff911f332655d788f73f4f2ef534e0572cee0 (patch)
tree0c1d7e8399c18e0d4ac2331ac6dcfa88ad2a915a
parentf58bd666fc080a6bbccf1a6a633fd6b547fbe936 (diff)
downloademacs-865ff911f332655d788f73f4f2ef534e0572cee0.tar.gz
emacs-865ff911f332655d788f73f4f2ef534e0572cee0.zip
(python-use-skeletons): Re-add.
(def-python-skeleton): Use it.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/progmodes/python.el14
2 files changed, 14 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8adb55338ed..041c0dd59ea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12009-02-12 Stefan Monnier <monnier@iro.umontreal.ca> 12009-02-12 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * progmodes/python.el (python-use-skeletons): Re-add.
4 (def-python-skeleton): Use it.
5
3 * international/quail.el (quail-make-guidance-frame): Remove the 6 * international/quail.el (quail-make-guidance-frame): Remove the
4 `parent-id' parameter. 7 `parent-id' parameter.
5 (quail-show-guidance): Make the new window dedicated. 8 (quail-show-guidance): Make the new window dedicated.
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)))))