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

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

[elpa] master 1d96da2 18/42: Don't call before/after change-functions tw


From: Noam Postavsky
Subject: [elpa] master 1d96da2 18/42: Don't call before/after change-functions twice
Date: Sun, 22 Dec 2019 17:37:59 -0500 (EST)

branch: master
commit 1d96da2e08664c31ff7f6f7441da1f4fa5680b1f
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Don't call before/after change-functions twice
    
    * yasnippet.el (yas--snippet-create): Let-bind
    inhibit-modification-hooks for snippet insertion, so that we don't
    call change functions automatically, we already call them manually
    after insertion and parsing.
---
 yasnippet.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index fec0983..065e709 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -4076,12 +4076,13 @@ Returns the newly created snippet."
       (yas--letenv expand-env
         ;; Put a single undo action for the expanded snippet's
         ;; content.
-        (let ((buffer-undo-list t))
+        (let ((buffer-undo-list t)
+              (inhibit-modification-hooks t))
           ;; Some versions of cc-mode fail when inserting snippet
           ;; content in a narrowed buffer, so make sure to insert
           ;; before narrowing.  Furthermore, call before and after
-          ;; change functions, otherwise cc-mode's cache can get
-          ;; messed up.
+          ;; change functions manually, otherwise cc-mode's cache can
+          ;; get messed up.
           (goto-char begin)
           (run-hook-with-args 'before-change-functions begin begin)
           (insert content)



reply via email to

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