diff --git a/yasnippet-tests.el b/yasnippet-tests.el index a780972..e009a72 100644 --- a/yasnippet-tests.el +++ b/yasnippet-tests.el @@ -855,6 +855,8 @@ mapconcat #'(lambda (arg) (defmacro yas--with-font-locked-temp-buffer (&rest body) "Like `with-temp-buffer', but ensure `font-lock-mode'." + ;; NOTE: Replace all uses of this with `font-lock-ensure' when we + ;; drop support for Emacs 24. (declare (indent 0) (debug t)) (let ((temp-buffer (make-symbol "temp-buffer"))) ;; NOTE: buffer name must not start with a space, otherwise @@ -874,6 +876,8 @@ mapconcat #'(lambda (arg) (kill-buffer ,temp-buffer)))))))) (ert-deftest example-for-issue-474 () + ;; This issue only reproduces in Emacs 24.3, most likely due to some + ;; bug in the cc-mode included with that Emacs version. (yas--with-font-locked-temp-buffer (c-mode) (yas-minor-mode 1) diff --git a/yasnippet.el b/yasnippet.el index 5b252a2..ac25669 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -4178,9 +4178,10 @@ Returns the newly created snippet." (run-hook-with-args 'before-change-functions begin end) (let ((before-change-functions nil) (after-change-functions nil)) - ;; Some versions of cc-mode fail when inserting snippet - ;; content in a narrowed buffer, so make sure to insert - ;; before narrowing. + ;; Some versions of cc-mode (might be the one with Emacs + ;; 24.3 only) fail when inserting snippet content in a + ;; narrowed buffer, so make sure to insert before + ;; narrowing. (insert content) (narrow-to-region begin (point)) (goto-char (point-min))