[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 85a43ad 35/40: Explain about backquote expressions in doc
From: |
Noam Postavsky |
Subject: |
[elpa] master 85a43ad 35/40: Explain about backquote expressions in doc |
Date: |
Wed, 26 Oct 2016 23:06:34 +0000 (UTC) |
branch: master
commit 85a43ad8e5981b75945a87df162e210bea8947dc
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Explain about backquote expressions in doc
* doc/snippet-development.org (Embedded Emacs-lisp code): Add a subsection
explaining that backquote expressions should not modify the buffer.
---
doc/snippet-development.org | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/doc/snippet-development.org b/doc/snippet-development.org
index 4fd293d..ffe648c 100644
--- a/doc/snippet-development.org
+++ b/doc/snippet-development.org
@@ -209,7 +209,7 @@ back-quotes (=`=). The lisp forms are evaluated when the
snippet is
being expanded. The evaluation is done in the same buffer as the
snippet being expanded.
-Here's an example for c-mode` to calculate the header file guard
+Here's an example for c-mode to calculate the header file guard
dynamically:
#+BEGIN_SRC snippet
@@ -235,6 +235,27 @@ to "wrap" the selected region inside your recently
inserted snippet.
Alternatively, you can also customize the variable
[[sym:yas-wrap-around-region][=yas-wrap-around-region=]] to =t= which will do
this automatically.
+*** Note: backquote expressions should not modify the buffer
+
+Please note that the lisp forms in backquotes should *not* modify the
+buffer, doing so will trigger a warning. For example, instead of
+doing
+
+#+BEGIN_SRC snippet
+ Timestamp: `(insert (current-time-string))`
+#+END_SRC
+
+do this:
+#+BEGIN_SRC snippet
+ Timestamp: `(current-time-string)`
+#+END_SRC
+
+The warning may be suppressed with the following code in your init file:
+#+BEGIN_SRC emacs-lisp
+ (add-to-list 'warning-suppress-types '(yasnippet backquote-change))
+#+END_SRC
+
+
** Tab stop fields
Tab stops are fields that you can navigate back and forth by =TAB= and
- [elpa] master dc098cf 25/40: Fix yas--message verbosity levels, (continued)
- [elpa] master dc098cf 25/40: Fix yas--message verbosity levels, Noam Postavsky, 2016/10/26
- [elpa] master 5af9276 27/40: Support yas/ symbols in yas-define-menu, Noam Postavsky, 2016/10/26
- [elpa] master ea9581f 22/40: Fix some quoting problems in doc strings, Noam Postavsky, 2016/10/26
- [elpa] master ee6e7a9 09/40: Fix some compilation warnings, Noam Postavsky, 2016/10/26
- [elpa] master 7661dc1 19/40: yasnippet.el (yas-escape-text): No error on nil text, Noam Postavsky, 2016/10/26
- [elpa] master 351c1e3 10/40: Don't indent first line of mirrors, Noam Postavsky, 2016/10/26
- [elpa] master 655bda8 07/40: Merge: restore backquote evaluation behaviour, Noam Postavsky, 2016/10/26
- [elpa] master 8907fd1 14/40: Escape yas-selected-text for new snippet., Noam Postavsky, 2016/10/26
- [elpa] master a4fafc3 16/40: Add test for loading snippet with same uuid, Noam Postavsky, 2016/10/26
- [elpa] master 8ca8c7d 13/40: Merge: a different fix for #712., Noam Postavsky, 2016/10/26
- [elpa] master 85a43ad 35/40: Explain about backquote expressions in doc,
Noam Postavsky <=
- [elpa] master 3129040 24/40: Load snippet after saving, Noam Postavsky, 2016/10/26
- [elpa] master 1532e66 33/40: Fix saving of new snippets, Noam Postavsky, 2016/10/26
- [elpa] master 0ee86a2 23/40: Simplify `yas-new-snippet' load&save logic, Noam Postavsky, 2016/10/26
- [elpa] master 00be21c 36/40: Change cl dep to cl-lib for tests too, Noam Postavsky, 2016/10/26
- [elpa] master 9c9952c 12/40: Add test for indentation of single line mirrors, Noam Postavsky, 2016/10/26
- [elpa] master 4296a86 15/40: yasnippet.el (yas--quote-string): Remove., Noam Postavsky, 2016/10/26
- [elpa] master d4da806 17/40: Fix removal of snippets by uuid, Noam Postavsky, 2016/10/26
- [elpa] master 42b0c26 18/40: Don't warn about modifications to other buffers, Noam Postavsky, 2016/10/26
- [elpa] master eaaec30 38/40: Replace all occurances of `capitaomorte', Noam Postavsky, 2016/10/26
- [elpa] master ff6f31e 37/40: Replace yas--with-temp-redefs with cl-letf, Noam Postavsky, 2016/10/26