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

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

[elpa] master 596e6b2 158/177: Closes #537: Be lenient to extensions ope


From: João Távora
Subject: [elpa] master 596e6b2 158/177: Closes #537: Be lenient to extensions operating on snippet fields
Date: Sat, 28 Mar 2015 15:41:38 +0000

branch: master
commit 596e6b2640ab80c8823a749c4da71af5dd2e6fe0
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Closes #537: Be lenient to extensions operating on snippet fields
    
    * yasnippet.el (yas--on-protection-overlay-modification): Commit the
    snippets being destroyed instead of signalling a protection violation.
---
 yasnippet.el |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index cb1d041..c93d886 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -3496,8 +3496,14 @@ The error should be ignored in `debug-ignored-errors'"
   (unless yas--inhibit-overlay-hooks
     (cond ((not (or after?
                     (yas--undo-in-progress)))
-           (setq yas--protection-violation (point))
-           (error "Exit the snippet first!")))))
+           (cond (t
+                  (let ((snippets (yas--snippets-at-point)))
+                    (yas--message 3 "Comitting snippets. Action would destroy 
a protection overlay.")
+                    (cl-loop for snippet in snippets
+                             do (yas--commit-snippet snippet))))
+                 (nil
+                  (setq yas--protection-violation (point))
+                  (error "Exit the snippet first!")))))))
 
 (add-to-list 'debug-ignored-errors "^Exit the snippet first!$")
 



reply via email to

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