mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-24 06:20:43 -08:00
(python-use-skeletons): Re-add.
(def-python-skeleton): Use it.
This commit is contained in:
parent
f58bd666fc
commit
865ff911f3
2 changed files with 14 additions and 3 deletions
|
|
@ -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<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 @@ 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)))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue