Variable: combobulate-python-envelope-list
combobulate-python-envelope-list is a variable defined in
combobulate-python.el.
Value
Large value
((:description "Decorate class or function" :key "@" :mark-node nil
:nodes ("function_definition" "class_definition") :name
"decorate" :template
((p @decorator "Decorator name"
(lambda (text)
(if (string-prefix-p "@" text) text
(concat "@" text))))
n>))
(:description "if ...: ... [else: ...]" :key "bi" :mark-node t
:shorthand statements :name "nest-if-else" :template
("if " @ (p True "Bool") ":" n>
(choice* :missing nil :rest
((save-column r> n) < "else:"
(save-column n> "pass" n))
:name "if-block")
(choice* :missing nil :rest
(@ (save-column "pass" n> "else:" n> r> n))
:name "else-block")))
(:description "try ... except ...: ..." :key "bte" :mark-node t
:shorthand statements :name "nest-try-except" :template
((save-column "try:" n>
(choice* :name "statement-block" :missing
(@ "pass") :rest (r>))
n)
"except " (p Exception "Exception") ":" n>
(choice* :name "handler-block" :missing (@ "pass" n>)
:rest (r> n))))
(:description "try ... finally: ..." :key "btf" :mark-node t
:shorthand statements :name "nest-try-finally"
:template
((save-column @ "try:" n>
(choice* :missing (@ "pass") :rest (r>)
:name "try-block")
n)
"finally:" n>
(choice* :missing (@ "pass") :rest (r>) :name
"finally-block")))
(:description "def ...():" :key "bd" :mark-node t :shorthand
statements :name "nest-def" :template
("def " (p name "Name") "(" @ ")" ":" n> r>))
(:description "for ...:" :key "bf" :mark-node t :shorthand statements
:name "nest-for" :template ("for " @ ":" n> r>))
(:description "with ...:" :key "bW" :mark-node t :shorthand
statements :name "nest-with" :template
("with " @ ":" n> r>))
(:description "while ...:" :key "bw" :mark-node t :shorthand
statements :name "nest-while" :template
("while " @ ":" n> r>)))
Documentation
List of envelope definitions for this language.
Each entry is a list of properties that define the envelope. The properties are:
(:description STRING
:name STRING
:key STRING
:mark-node <t/nil>
:template ENVELOPE
[:extra-key STRING]
[:shorthand SHORTHAND-SYMBOL]
[:nodes NODES]
[:point-placement <stay/after/before>])
Where :description is a human-readable description of the envelope.
:name is the name of the envelope that will be
inserted into the envelope command.
:key is the key binding (in kbd macro format) to bind to the
envelope such that it is created under C-c o e
<key>. :extra-key is an optional key binding that is bound to
any arbitrary key binding.
:shorthand is a shorthand symbol to use in place of
:nodes (see the shorthand procedures alist variable)
:nodesis a list of nodes to look for at/around point before
expanding the envelope template.
:mark-node is a boolean that determines whether to mark the
node that :nodes (or :shorthand) matches and remove it and
insert it into the r/r> registers.
:template is the template to insert. See
combobulate-envelope-expand-instructions for a complete
description of the template format.
:point-placement is a symbol that determines where point is
placed after the envelope is inserted. It can be stay,
after, or before.
Source Code
;; Defined in /nix/store/b5fvrwzi3zvkabyzx0in6gw1cj963z46-emacs-packages-deps/share/emacs/site-lisp/combobulate-python.el