]> code.delx.au - gnu-emacs-elpa/commitdiff
Revert "Disable region wrapping for trigger key expansion"
authorNoam Postavsky <npostavs@users.sourceforge.net>
Thu, 28 Apr 2016 23:21:07 +0000 (19:21 -0400)
committerNoam Postavsky <npostavs@users.sourceforge.net>
Sun, 1 May 2016 00:17:38 +0000 (20:17 -0400)
This reverts commit f8d1af1f50f42ac1689c583c152c3b15e8774ae4.

Disabling this for trigger key introduced an inconsistency that is more
complicated to implement and document than simply fixing region wrapping
for trigger key expanded snippets.

doc/snippet-expansion.org
yasnippet.el

index 47a857a77a4f1d2e3766dd2e6364759a99f0cd1b..f57df95cc17be02b35f255749a4ca71c2dee447e 100644 (file)
@@ -29,7 +29,7 @@
 
    - 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.
@@ -91,10 +91,6 @@ the region contents into the =$0= placeholder of a snippet expanded by
 [[#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
index caef9ca6b6147f8114b2987d2fc248d4cba64ffd..423f58a9eb30b81488a870c671a64aebd0fc3ea8 100644 (file)
@@ -2160,12 +2160,7 @@ Optional argument FIELD is for non-interactive use and is an
 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