From 42b0c269caa01d397446ddf4c3c6936158c757d6 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 5 Jul 2016 23:38:09 -0400 Subject: [PATCH] Don't warn about modifications to other buffers * yasnippet.el (yas--save-backquotes): Detect changes only in buffer where snippet is being expanded. --- yasnippet.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index 8796e6a..ccef85d 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -4008,8 +4008,11 @@ With optional string TEXT do it in string instead of the buffer." (defun yas--save-backquotes () "Save all the \"`(lisp-expression)`\"-style expressions with their evaluated value into `yas--backquote-markers-and-strings'." - (let* ((yas--change-detected nil) - (detect-change (lambda (_beg _end) (setq yas--change-detected t)))) + (let* ((yas--snippet-buffer (current-buffer)) + (yas--change-detected nil) + (detect-change (lambda (_beg _end) + (when (eq (current-buffer) yas--snippet-buffer) + (setq yas--change-detected t))))) (while (re-search-forward yas--backquote-lisp-expression-regexp nil t) (let ((current-string (match-string-no-properties 1)) transformed) (save-restriction (widen)