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

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

[elpa] master 90d4cae 013/177: inhibit change hooks during (insert conte


From: João Távora
Subject: [elpa] master 90d4cae 013/177: inhibit change hooks during (insert content)
Date: Sat, 28 Mar 2015 15:40:29 +0000

branch: master
commit 90d4cae1b1bbfacc612e73444f1e5a723ae4036e
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    inhibit change hooks during (insert content)
    
    `yas-expand-snippet' narrows to a 0 size region before doing (insert
    content), this confuses cc-mode's before-change-functions that
    invalidate some cached information. Binding `inhibit-modification-hooks'
    to `t' prevents calling these functions.
    
    Fixes #404.
---
 yasnippet.el |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index f1bba52..8fb14b4 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -3523,9 +3523,11 @@ considered when expanding the snippet."
                  (setq snippet
                        (if expand-env
                            (eval `(let* ,expand-env
-                                    (insert content)
+                                    (let ((inhibit-modification-hooks t))
+                                      (insert content))
                                     (yas--snippet-create (point-min))))
-                         (insert content)
+                         (let ((inhibit-modification-hooks t))
+                           (insert content))
                          (yas--snippet-create (point-min)))))))
 
            ;; stacked-expansion: This checks for stacked expansion, save the



reply via email to

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