[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/yasnippet 5b1217a 6/8: ; Add some notes about narrowing
From: |
Stefan Monnier |
Subject: |
[elpa] externals/yasnippet 5b1217a 6/8: ; Add some notes about narrowing, font-lock cc-mode issues |
Date: |
Mon, 15 Mar 2021 22:25:53 -0400 (EDT) |
branch: externals/yasnippet
commit 5b1217ab085fab4abeb1118dccb260691b446703
Author: Noam Postavsky <npostavs@users.sourceforge.net>
Commit: Noam Postavsky <npostavs@users.sourceforge.net>
; Add some notes about narrowing, font-lock cc-mode issues
* yasnippet-tests.el (yas--with-font-locked-temp-buffer)
(example-for-issue-474):
* yasnippet.el (yas--snippet-create): Add commentary.
---
yasnippet-tests.el | 4 ++++
yasnippet.el | 7 ++++---
2 files changed, 8 insertions(+), 3 deletions(-)
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))
- [elpa] externals/yasnippet updated (3bf9a3b -> 5cbdbf0), Stefan Monnier, 2021/03/15
- [elpa] externals/yasnippet 5b1217a 6/8: ; Add some notes about narrowing, font-lock cc-mode issues,
Stefan Monnier <=
- [elpa] externals/yasnippet 1cc1996 5/8: Don't bind inhibit-modification-hooks in yas--snippet-create, Stefan Monnier, 2021/03/15
- [elpa] externals/yasnippet d3d6d70 7/8: Correct manual call to after-change-functions, Stefan Monnier, 2021/03/15
- [elpa] externals/yasnippet 291873e 4/8: ; .travis.yml: Clean up validator warnings/infos, Stefan Monnier, 2021/03/15
- [elpa] externals/yasnippet ac03c2f 1/8: ; Test on Emacs 27, Stefan Monnier, 2021/03/15
- [elpa] externals/yasnippet 170d13d 3/8: Scan nested fields properly, Stefan Monnier, 2021/03/15
- [elpa] externals/yasnippet 7c02bc1 2/8: Fix failure on depth 2+ nested snippets, Stefan Monnier, 2021/03/15
- [elpa] externals/yasnippet 5cbdbf0 8/8: Handle errors during evaluation properly, Stefan Monnier, 2021/03/15