- Expanding from emacs-lisp code
-** <<Trigger key>>
+** Trigger key
[[sym:yas-expand][=yas-expand=]] tries to expand a /snippet abbrev/ (also known as
/snippet key/) before point.
[[#yas-insert-snippet][=yas-insert-snippet=]]. Setting it to a character value (e.g. =?0=)
will insert the contents of corresponding register.
-Note a setting of t is disabled when expanding via [[trigger key]] since
-it's too awkward to highlight the relevant text while maneuvering
-point in front of the trigger key.
-
Older (versions 0.9.1 and below) of Yasnippet, supported a setting of
=cua= that is equivalent to =?0= but only worked with =cua-mode=
turned on. This setting is still supported for backwards
object satisfying `yas--field-p' to restrict the expansion to."
(interactive)
(setq yas--condition-cache-timestamp (current-time))
- (let ((templates-and-pos nil)
- ;; Disable region wrapping for trigger key expansion: it's too
- ;; awkward to have point after the trigger while managing the
- ;; region contents anyway.
- (yas-wrap-around-region (if (eq yas-wrap-around-region t) nil
- yas-wrap-around-region)))
+ (let (templates-and-pos)
(unless (and yas-expand-only-for-last-commands
(not (member last-command yas-expand-only-for-last-commands)))
(setq templates-and-pos (if field