[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/yasnippet bd2fdc8f7d 6/6: * yasnippet.el (yas--snippet-
From: |
ELPA Syncer |
Subject: |
[elpa] externals/yasnippet bd2fdc8f7d 6/6: * yasnippet.el (yas--snippet-create): Remove CC-mode workaround for #953 |
Date: |
Mon, 1 Jan 2024 21:59:07 -0500 (EST) |
branch: externals/yasnippet
commit bd2fdc8f7da489972e36222ec5a64c85f4a81b4b
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* yasnippet.el (yas--snippet-create): Remove CC-mode workaround for #953
---
yasnippet.el | 47 ++++++++++++++++++++++++++++-------------------
1 file changed, 28 insertions(+), 19 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index b64e48808e..d6c2c12371 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -4075,25 +4075,34 @@ Returns the newly created snippet."
;; content.
(let ((buffer-undo-list t))
(goto-char begin)
- ;; Call before and after change functions manually,
- ;; otherwise cc-mode's cache can get messed up. Don't use
- ;; `inhibit-modification-hooks' for that, that blocks
- ;; overlay and text property hooks as well! FIXME: Maybe
- ;; use `combine-change-calls'? (Requires Emacs 27+ though.)
- (run-hook-with-args 'before-change-functions begin end)
- (let ((before-change-functions nil)
- (after-change-functions nil))
- ;; 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))
- (yas--snippet-parse-create snippet))
- (run-hook-with-args 'after-change-functions
- (point-min) (point-max)
- (- end begin)))
+ (if (> emacs-major-version 29)
+ ;; Don't use the workaround for CC-mode's cache,
+ ;; since it was presumably a bug in CC-mode, so either
+ ;; it's fixed already, or it should get fixed.
+ (progn
+ (insert content)
+ (narrow-to-region begin (point))
+ (goto-char (point-min))
+ (yas--snippet-parse-create snippet))
+ ;; Call before and after change functions manually,
+ ;; otherwise cc-mode's cache can get messed up. Don't use
+ ;; `inhibit-modification-hooks' for that, that blocks
+ ;; overlay and text property hooks as well! FIXME: Maybe
+ ;; use `combine-change-calls'? (Requires Emacs 27+ though.)
+ (run-hook-with-args 'before-change-functions begin end)
+ (let ((before-change-functions nil)
+ (after-change-functions nil))
+ ;; 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))
+ (yas--snippet-parse-create snippet))
+ (run-hook-with-args 'after-change-functions
+ (point-min) (point-max)
+ (- end begin))))
(when (listp buffer-undo-list)
(push (cons (point-min) (point-max))
buffer-undo-list))
- [elpa] externals/yasnippet updated (b86b44cce6 -> bd2fdc8f7d), ELPA Syncer, 2024/01/01
- [elpa] externals/yasnippet 9596631bde 1/6: * README.mdown: Tweak install instructions, ELPA Syncer, 2024/01/01
- [elpa] externals/yasnippet 2b328e563e 2/6: * yasnippet.el (yas-wrap-around-region): Fix warning, ELPA Syncer, 2024/01/01
- [elpa] externals/yasnippet bcefd0a1c1 3/6: * yasnippet.el: Remove compatibility for Emacs<24.4, ELPA Syncer, 2024/01/01
- [elpa] externals/yasnippet 66db827a86 4/6: yasnippet.el: Use `setq-local` and `defvar-local`, ELPA Syncer, 2024/01/01
- [elpa] externals/yasnippet bd2fdc8f7d 6/6: * yasnippet.el (yas--snippet-create): Remove CC-mode workaround for #953,
ELPA Syncer <=
- [elpa] externals/yasnippet 362e9b551d 5/6: yasnippet.el (yas-about): Use `package-get-version`, ELPA Syncer, 2024/01/01