diff --git a/yasnippet-tests.el b/yasnippet-tests.el index 7e10095..e8d2847 100644 --- a/yasnippet-tests.el +++ b/yasnippet-tests.el @@ -1438,7 +1438,6 @@ hello ${1:$(when (stringp yas-text) (funcall func yas-text))} foo${1:$$(concat \ (yas-with-snippet-dirs '((".emacs.d/snippets" ("yas--test-mode"))) (yas-reload-all) - (put 'c-mode 'yas--all-parents nil) (with-temp-buffer (let* ((major-mode 'yas--test-mode) (expected `(fundamental-mode diff --git a/yasnippet.el b/yasnippet.el index 35b4887..fa36be7 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -824,6 +824,10 @@ which decides on the snippet to expand.") ;; Prevent sharing the tail. (append lists '(()) ))))))) +(defun yas--flush-all-parents (mode) + (if (get mode 'yas--all-parents) + (put mode 'yas--all-parents nil))) + (defun yas--all-parents (mode) "Like `derived-mode-all-parents' but obeying `yas--parents'." (or (get mode 'yas--all-parents) ;; FIXME: Use `with-memoization'? @@ -2010,6 +2014,9 @@ prefix argument." (with-current-buffer buffer yas--editing-template)) (buffer-list)))) + + (mapatoms #'yas--flush-all-parents) + ;; Warn if there are buffers visiting snippets, since reloading will break ;; any on-line editing of those buffers. ;;