[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c1b2cb7 17/36: Improve documentation for new register opti
From: |
Noam Postavsky |
Subject: |
[elpa] master c1b2cb7 17/36: Improve documentation for new register option |
Date: |
Sat, 11 Jun 2016 19:21:10 +0000 (UTC) |
branch: master
commit c1b2cb7c5e108f68268f4cff1081aebce2cbbaf5
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Improve documentation for new register option
* doc/snippet-expansion.org: Add new section about
yas-wrap-around-region.
* yasnippet.el (yas-wrap-around-region): Improve docstring.
---
doc/snippet-expansion.org | 13 +++++++++++++
yasnippet.el | 4 +++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/doc/snippet-expansion.org b/doc/snippet-expansion.org
index fdc02cc..f57df95 100644
--- a/doc/snippet-expansion.org
+++ b/doc/snippet-expansion.org
@@ -83,6 +83,19 @@ snippets for the major mode, prefix this command with =C-u=.
The prompting methods used are again controlled by
[[sym:yas-prompt-functions][=yas-prompt-functions=]].
+*** Inserting region or register contents into snippet
+
+It's often useful to inject already written text in the middle of a
+snippet. The variable
[[sym:yas-wrap-around-region][=yas-wrap-around-region=]] when to t substitute
+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.
+
+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
+compatibility, but is now entirely equivalent to =?0=.
+
** Snippet keybinding
See the section of the =# binding:= directive in
diff --git a/yasnippet.el b/yasnippet.el
index 47618f9..423f58a 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -349,7 +349,9 @@ Any other non-nil value, every submenu is listed."
"What to insert for snippet's $0 field.
If set to a character, insert contents of corresponding register.
-If non-nil insert region contents."
+If non-nil insert region contents. This can be overridden on a
+per-snippet basis. A value of `cua' is considered equivalent to
+`?0' for backwards compatibility."
:type '(choice (character :tag "Insert from register")
(const t :tag "Insert region contents")
(const nil :tag "Don't insert anything")
- [elpa] master 4f2aa15 05/36: Only kill snippets for text length change, (continued)
- [elpa] master 4f2aa15 05/36: Only kill snippets for text length change, Noam Postavsky, 2016/06/11
- [elpa] master 8771082 03/36: Don't add useless kill ring entries, Noam Postavsky, 2016/06/11
- [elpa] master cc14db3 11/36: Refactor yas-next-field a bit, Noam Postavsky, 2016/06/11
- [elpa] master db4cd31 20/36: Delete active region for trigger key expansion, Noam Postavsky, 2016/06/11
- [elpa] master e37ce9e 18/36: Disable region wrapping for trigger key expansion, Noam Postavsky, 2016/06/11
- [elpa] master 6180cc4 28/36: Fix field transform application in yas-next-field, Noam Postavsky, 2016/06/11
- [elpa] master 146b161 25/36: Don't indent empty lines in snippet expansion, Noam Postavsky, 2016/06/11
- [elpa] master e9406f5 26/36: Document $> and fix escaping, Noam Postavsky, 2016/06/11
- [elpa] master 6f97316 27/36: Fix outdated and misformatted docs, Noam Postavsky, 2016/06/11
- [elpa] master bd30a30 04/36: yas-dont-activate is a hook, Noam Postavsky, 2016/06/11
- [elpa] master c1b2cb7 17/36: Improve documentation for new register option,
Noam Postavsky <=
- [elpa] master 4c6064c 01/36: Avoid potential problems with user's hooks, Noam Postavsky, 2016/06/11
- [elpa] master 5d44a9f 19/36: Revert "Disable region wrapping for trigger key expansion", Noam Postavsky, 2016/06/11
- [elpa] master beb2ba4 21/36: Fix fields following $0 + region insertion, Noam Postavsky, 2016/06/11
- [elpa] master eeb4b62 14/36: Add new tests for multi-line mirror indentation, Noam Postavsky, 2016/06/11
- [elpa] master 78fe979 22/36: Support htmlize.el in Rakefile doc target, Noam Postavsky, 2016/06/11
- [elpa] master 7f03a23 07/36: Change Emacs installation method for Travis CI, Noam Postavsky, 2016/06/11
- [elpa] master 0d79e69 30/36: Extra measures to prevent premature yas-minor-mode, Noam Postavsky, 2016/06/11
- [elpa] master 497867c 32/36: Rename yas-backport-obsolete-alias, Noam Postavsky, 2016/06/11
- [elpa] master e23a053 34/36: Avoid bug in insert-file-contents with REPLACE=t, Noam Postavsky, 2016/06/11
- [elpa] master 567ada0 06/36: Decide field clearing based on command's effect, Noam Postavsky, 2016/06/11