diff options
| author | Dmitry Gutov | 2013-10-11 03:45:03 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2013-10-11 03:45:03 +0300 |
| commit | 0922b8260ac76c153b253c992c1a656fca1a22e2 (patch) | |
| tree | da6ae4a3419713020539e40094decafc5ac87d03 | |
| parent | 6d8ca1720a1795d15493f03005390d8ffc559f30 (diff) | |
| download | emacs-0922b8260ac76c153b253c992c1a656fca1a22e2.tar.gz emacs-0922b8260ac76c153b253c992c1a656fca1a22e2.zip | |
* lisp/emacs-lisp/smie.el (smie--matching-block-data): Invalidate the
cache also after commands that modify the buffer but don't move
point.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/smie.el | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1a312606ee0..362447e651c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-10-11 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * emacs-lisp/smie.el (smie--matching-block-data): Invalidate the | ||
| 4 | cache also after commands that modify the buffer but don't move | ||
| 5 | point. | ||
| 6 | |||
| 1 | 2013-10-10 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2013-10-10 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * env.el (substitute-env-in-file-name): New function. | 9 | * env.el (substitute-env-in-file-name): New function. |
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 32dcb2ed744..ebb82f4bf54 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el | |||
| @@ -1062,10 +1062,12 @@ OPENER is non-nil if TOKEN is an opener and nil if it's a closer." | |||
| 1062 | (defun smie--matching-block-data (orig &rest args) | 1062 | (defun smie--matching-block-data (orig &rest args) |
| 1063 | "A function suitable for `show-paren-data-function' (which see)." | 1063 | "A function suitable for `show-paren-data-function' (which see)." |
| 1064 | (if (or (null smie-closer-alist) | 1064 | (if (or (null smie-closer-alist) |
| 1065 | (eq (point) (car smie--matching-block-data-cache))) | 1065 | (equal (cons (point) (buffer-chars-modified-tick)) |
| 1066 | (car smie--matching-block-data-cache))) | ||
| 1066 | (or (cdr smie--matching-block-data-cache) | 1067 | (or (cdr smie--matching-block-data-cache) |
| 1067 | (apply orig args)) | 1068 | (apply orig args)) |
| 1068 | (setq smie--matching-block-data-cache (list (point))) | 1069 | (setq smie--matching-block-data-cache |
| 1070 | (list (cons (point) (buffer-chars-modified-tick)))) | ||
| 1069 | (unless (nth 8 (syntax-ppss)) | 1071 | (unless (nth 8 (syntax-ppss)) |
| 1070 | (condition-case nil | 1072 | (condition-case nil |
| 1071 | (let ((here (smie--opener/closer-at-point))) | 1073 | (let ((here (smie--opener/closer-at-point))) |
| @@ -1108,7 +1110,7 @@ OPENER is non-nil if TOKEN is an opener and nil if it's a closer." | |||
| 1108 | (nth 1 there) (nth 2 there) | 1110 | (nth 1 there) (nth 2 there) |
| 1109 | (not (nth 0 there))))))) | 1111 | (not (nth 0 there))))))) |
| 1110 | (scan-error nil)) | 1112 | (scan-error nil)) |
| 1111 | (goto-char (car smie--matching-block-data-cache))) | 1113 | (goto-char (caar smie--matching-block-data-cache))) |
| 1112 | (apply #'smie--matching-block-data orig args))) | 1114 | (apply #'smie--matching-block-data orig args))) |
| 1113 | 1115 | ||
| 1114 | ;;; The indentation engine. | 1116 | ;;; The indentation engine. |