[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c5fddf8 34/63: Restore syntax-propertize-function before i
From: |
Noam Postavsky |
Subject: |
[elpa] master c5fddf8 34/63: Restore syntax-propertize-function before indenting snippet |
Date: |
Mon, 17 Jul 2017 22:54:16 -0400 (EDT) |
branch: master
commit c5fddf8cec39ca3e68ad04e9462f185dfc1e7eb2
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Restore syntax-propertize-function before indenting snippet
* yasnippet.el (yas--snippet-parse-create): Some modes require correct
syntax-propertizing to indent properly.
---
yasnippet.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index 1e82776..605fbae 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -3688,17 +3688,10 @@ considered when expanding the snippet."
;; them mostly to make the undo information
;;
(setq yas--start-column (current-column))
- (let ((yas--inhibit-overlay-hooks t)
- ;; Avoid major-mode's syntax propertizing function,
- ;; since we mess with the syntax-table and also
- ;; insert things that are not valid in the
- ;; major-mode language syntax anyway.
- (syntax-propertize-function nil))
+ (let ((yas--inhibit-overlay-hooks t))
(insert content)
(setq snippet
- (yas--snippet-create expand-env start (point))))
- ;; Invalidate any syntax-propertizing done while
`syntax-propertize-function' was nil
- (syntax-ppss-flush-cache start))
+ (yas--snippet-create expand-env start (point)))))
;; stacked-expansion: This checks for stacked expansion, save the
;; `yas--previous-active-field' and advance its boundary.
@@ -3948,7 +3941,10 @@ expansion.")
necessary fields, mirrors and exit points.
Meant to be called in a narrowed buffer, does various passes"
- (let ((parse-start (point)))
+ (let ((parse-start (point))
+ ;; Avoid major-mode's syntax propertizing function, since we
+ ;; change the syntax-table while calling `scan-sexps'.
+ (syntax-propertize-function nil))
;; Reset the yas--dollar-regions
;;
(setq yas--dollar-regions nil)
@@ -4011,7 +4007,10 @@ Meant to be called in a narrowed buffer, does various
passes"
;; indent the best we can
;;
(goto-char parse-start)
- (yas--indent snippet)))
+ ;; Invalidate any syntax-propertizing done while
+ ;; `syntax-propertize-function' was nil.
+ (syntax-ppss-flush-cache parse-start))
+ (yas--indent snippet))
;; HACK: Some implementations of `indent-line-function' (called via
;; `indent-according-to-mode') delete text before they insert (like
- [elpa] master e878afb 12/63: Update handling of markers during indentation, (continued)
- [elpa] master e878afb 12/63: Update handling of markers during indentation, Noam Postavsky, 2017/07/17
- [elpa] master 6c4fbb2 24/63: Fix snippet local exit hook, Noam Postavsky, 2017/07/17
- [elpa] master d0c6fec 16/63: Refactor snippet marker manipulating functions, Noam Postavsky, 2017/07/17
- [elpa] master e74f00e 18/63: Fix whitespace lossage between mirrors, Noam Postavsky, 2017/07/17
- [elpa] master 4f37afd 27/63: Let snippets expand in strings/comments by default, Noam Postavsky, 2017/07/17
- [elpa] master cddb826 29/63: Merge: let snippets expand in strings/comments by default, Noam Postavsky, 2017/07/17
- [elpa] master 462f566 44/63: Don't leave unreadable objects in the undo list, Noam Postavsky, 2017/07/17
- [elpa] master 3949421 41/63: Fix problems with auto-fill-mode interaction, Noam Postavsky, 2017/07/17
- [elpa] master 0d9afb2 31/63: Fix mirror transformation error with expand-env, Noam Postavsky, 2017/07/17
- [elpa] master b4d2f9c 37/63: Update snippets submodule, Noam Postavsky, 2017/07/17
- [elpa] master c5fddf8 34/63: Restore syntax-propertize-function before indenting snippet,
Noam Postavsky <=
- [elpa] master 5043a96 38/63: Correctly wrap auto-fill-function when it's toggled on later, Noam Postavsky, 2017/07/17
- [elpa] master 30913fd 35/63: Only update live snippets, Noam Postavsky, 2017/07/17
- [elpa] master 0f6d82f 46/63: * .travis.yml: Use Emacs 25.2, Noam Postavsky, 2017/07/17
- [elpa] master 6102ff5 50/63: Handle undo of snippet 1st line indent properly, Noam Postavsky, 2017/07/17
- [elpa] master ac26024 20/63: Rework error handling, Noam Postavsky, 2017/07/17
- [elpa] master c3a9447 43/63: Fix condition timestamps in key filter functions, Noam Postavsky, 2017/07/17
- [elpa] master 82818e5 48/63: Don't delete snippets more than once., Noam Postavsky, 2017/07/17
- [elpa] master 63f44b4 33/63: Ensure inhibit-modification-hooks is nil while modifying buffer, Noam Postavsky, 2017/07/17
- [elpa] master 0041efe 17/63: Make snippets work in org source blocks, Noam Postavsky, 2017/07/17
- [elpa] master 47f37f7 42/63: Fix ${0:soon-to-be-deleted} with no other fields, Noam Postavsky, 2017/07/17