From 72c6c4cd7b0e58631e0963ea5345890e1b0aa04b Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 11 Oct 2015 21:18:52 -0400 Subject: [PATCH] Fix #618; save match data in yas--scan-sexps * yasnippet.el (yas--scan-sexps): Save match data. --- yasnippet.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index 706c86a..50973e9 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -4015,8 +4015,9 @@ with their evaluated value into `yas--backquote-markers-and-strings'." (defun yas--scan-sexps (from count) (ignore-errors - (with-syntax-table (standard-syntax-table) - (scan-sexps from count)))) + (save-match-data ; `scan-sexps' may modify match data. + (with-syntax-table (standard-syntax-table) + (scan-sexps from count))))) (defun yas--make-marker (pos) "Create a marker at POS with nil `marker-insertion-type'."