From: Dmitry Gutov Date: Fri, 11 Oct 2013 00:45:03 +0000 (+0300) Subject: * lisp/emacs-lisp/smie.el (smie--matching-block-data): Invalidate the X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1292 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0922b8260ac76c153b253c992c1a656fca1a22e2;p=emacs.git * lisp/emacs-lisp/smie.el (smie--matching-block-data): Invalidate the cache also after commands that modify the buffer but don't move point. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1a312606ee0..362447e651c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-10-11 Dmitry Gutov + + * emacs-lisp/smie.el (smie--matching-block-data): Invalidate the + cache also after commands that modify the buffer but don't move + point. + 2013-10-10 Stefan Monnier * 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." (defun smie--matching-block-data (orig &rest args) "A function suitable for `show-paren-data-function' (which see)." (if (or (null smie-closer-alist) - (eq (point) (car smie--matching-block-data-cache))) + (equal (cons (point) (buffer-chars-modified-tick)) + (car smie--matching-block-data-cache))) (or (cdr smie--matching-block-data-cache) (apply orig args)) - (setq smie--matching-block-data-cache (list (point))) + (setq smie--matching-block-data-cache + (list (cons (point) (buffer-chars-modified-tick)))) (unless (nth 8 (syntax-ppss)) (condition-case nil (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." (nth 1 there) (nth 2 there) (not (nth 0 there))))))) (scan-error nil)) - (goto-char (car smie--matching-block-data-cache))) + (goto-char (caar smie--matching-block-data-cache))) (apply #'smie--matching-block-data orig args))) ;;; The indentation engine.