From 865ff911f332655d788f73f4f2ef534e0572cee0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 12 Feb 2009 18:16:26 +0000 Subject: [PATCH] (python-use-skeletons): Re-add. (def-python-skeleton): Use it. --- lisp/ChangeLog | 3 +++ lisp/progmodes/python.el | 14 +++++++++++--- 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 @@ 2009-02-12 Stefan Monnier + * progmodes/python.el (python-use-skeletons): Re-add. + (def-python-skeleton): Use it. + * international/quail.el (quail-make-guidance-frame): Remove the `parent-id' parameter. (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." ;;;; 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) + (define-abbrev-table 'python-mode-abbrev-table () "Abbrev table for Python mode." :case-fixed t @@ -2221,9 +2228,10 @@ Interactively, prompt for name." `(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))))) -- 2.39.5