emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 5d44a9f 19/36: Revert "Disable region wrapping for trigger


From: Noam Postavsky
Subject: [elpa] master 5d44a9f 19/36: Revert "Disable region wrapping for trigger key expansion"
Date: Sat, 11 Jun 2016 19:21:10 +0000 (UTC)

branch: master
commit 5d44a9f15e446b34ec2baa1e2d78657c1ed8ae82
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Revert "Disable region wrapping for trigger key expansion"
    
    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 |    6 +-----
 yasnippet.el              |    7 +------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/doc/snippet-expansion.org b/doc/snippet-expansion.org
index 47a857a..f57df95 100644
--- a/doc/snippet-expansion.org
+++ b/doc/snippet-expansion.org
@@ -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
diff --git a/yasnippet.el b/yasnippet.el
index caef9ca..423f58a 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]