[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 885237a 174/177: Add useful development assertion
From: |
João Távora |
Subject: |
[elpa] master 885237a 174/177: Add useful development assertion |
Date: |
Sat, 28 Mar 2015 15:41:44 +0000 |
branch: master
commit 885237a4856ff22f0df82ab25e7ea3391a8376bd
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Add useful development assertion
When debugging snippets after M-x toggle-debug-on-error, errors in the
`post-command-hook' might cause `yas--post-command-handler' to be
removed. That's OK, always check that it's there before attempting any
`yas-expand-snippet' calls, since it is essential to check snippet
movement.
* yasnippet.el (yas-expand-snippet): Assert `yas-minor-mode' and
`yas--post-command-handler' active.
---
yasnippet.el | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index 2a2254b..95c96e4 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -3490,6 +3490,10 @@ The error should be ignored in `debug-ignored-errors'"
Text between START and END will be deleted before inserting
template. EXPAND-ENV is a list of (SYM VALUE) let-style dynamic bindings
considered when expanding the snippet."
+ (cl-assert (and yas-minor-mode
+ (memq 'yas--post-command-handler post-command-hook))
+ nil
+ "[yas] `yas-expand-snippet' needs properly setup
`yas-minor-mode'")
(run-hooks 'yas-before-expand-snippet-hook)
;;
- [elpa] master b62bdf3 163/177: Closes #546: backport `yas-initialize' and provide `yas/initialize', (continued)
- [elpa] master b62bdf3 163/177: Closes #546: backport `yas-initialize' and provide `yas/initialize', João Távora, 2015/03/28
- [elpa] master e161fc0 162/177: Merge pull request #542 from tarsius/nosearch, João Távora, 2015/03/28
- [elpa] master 07734a1 165/177: Clarify what happens with yas-new-snippet., João Távora, 2015/03/28
- [elpa] master 3c13348 167/177: yas-expand-snippet: Clarify EXPAND-ENV, João Távora, 2015/03/28
- [elpa] master 21ffe4b 168/177: Merge pull request #559 from mineo/patch-1, João Távora, 2015/03/28
- [elpa] master 197ef7f 166/177: Merge pull request #552 from treese/master, João Távora, 2015/03/28
- [elpa] master 3e7b56e 169/177: Implements #566: Remove dead major modes code, João Távora, 2015/03/28
- [elpa] master b9989f8 170/177: Add a CONTRIBUTING.md file, João Távora, 2015/03/28
- [elpa] master 316435e 173/177: Closes #562: Deleting inner numberless snippet causes error, João Távora, 2015/03/28
- [elpa] master fc5052b 171/177: Merge pull request #568 from npostavs/contrib, João Távora, 2015/03/28
- [elpa] master 885237a 174/177: Add useful development assertion,
João Távora <=
- [elpa] master a467019 175/177: `yas-minor-mode' assertion broke a test. Good. Fix it., João Távora, 2015/03/28
- [elpa] master d19ef74 172/177: Getting rid of low-level assumptions in yasnippet, João Távora, 2015/03/28
- [elpa] master 73701d9 176/177: Update packages/darkroom by merging its external subtree, João Távora, 2015/03/28
- [elpa] master 4f27187 062/177: refactor: removed extras and snippets tree, both point to submodules, João Távora, 2015/03/28
- [elpa] master 1cf9168 068/177: Merge branch 'unclutter': snippets and textmate importation snippets are now submodules, João Távora, 2015/03/28
- [elpa] master 39a27b6 177/177: Update packages/yasnippet by merging from its external upstream subtree, João Távora, 2015/03/28