diff options
| author | Stefan Monnier | 2019-03-16 20:11:45 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-03-16 20:11:45 -0400 |
| commit | 3320fe2deeba6dcc40e934e8a03bef4945c86aff (patch) | |
| tree | ad7c661cda2f58bdc0def352ba1edae6ecc0c65c | |
| parent | cc06d76865a7a98b5fd4edd03a044f2baefb85a9 (diff) | |
| download | emacs-3320fe2deeba6dcc40e934e8a03bef4945c86aff.tar.gz emacs-3320fe2deeba6dcc40e934e8a03bef4945c86aff.zip | |
* lisp/subr.el (combine-change-calls-1): Don't combine syntax-ppss flushes
| -rw-r--r-- | lisp/emacs-lisp/syntax.el | 5 | ||||
| -rw-r--r-- | lisp/subr.el | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index 11cab1d693d..d09d6c12254 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el | |||
| @@ -533,6 +533,11 @@ running the hook." | |||
| 533 | 533 | ||
| 534 | ;; Setup the before-change function if necessary. | 534 | ;; Setup the before-change function if necessary. |
| 535 | (unless (or ppss-cache ppss-last) | 535 | (unless (or ppss-cache ppss-last) |
| 536 | ;; We should be either the very last function on | ||
| 537 | ;; before-change-functions or the very first on | ||
| 538 | ;; after-change-functions. | ||
| 539 | ;; Note: combine-change-calls-1 needs to be kept in sync | ||
| 540 | ;; with this! | ||
| 536 | (add-hook 'before-change-functions | 541 | (add-hook 'before-change-functions |
| 537 | 'syntax-ppss-flush-cache t t)) | 542 | 'syntax-ppss-flush-cache t t)) |
| 538 | 543 | ||
diff --git a/lisp/subr.el b/lisp/subr.el index 4024c68e68d..6c0ad00afa5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -3686,7 +3686,7 @@ the specified region. It must not change | |||
| 3686 | `before-change-functions' or `after-change-functions'. | 3686 | `before-change-functions' or `after-change-functions'. |
| 3687 | 3687 | ||
| 3688 | Additionally, the buffer modifications of BODY are recorded on | 3688 | Additionally, the buffer modifications of BODY are recorded on |
| 3689 | the buffer's undo list as a single \(apply ...) entry containing | 3689 | the buffer's undo list as a single (apply ...) entry containing |
| 3690 | the function `undo--wrap-and-run-primitive-undo'." | 3690 | the function `undo--wrap-and-run-primitive-undo'." |
| 3691 | (let ((old-bul buffer-undo-list) | 3691 | (let ((old-bul buffer-undo-list) |
| 3692 | (end-marker (copy-marker end t)) | 3692 | (end-marker (copy-marker end t)) |
| @@ -3699,7 +3699,14 @@ the function `undo--wrap-and-run-primitive-undo'." | |||
| 3699 | (if (eq buffer-undo-list t) | 3699 | (if (eq buffer-undo-list t) |
| 3700 | (setq result (funcall body)) | 3700 | (setq result (funcall body)) |
| 3701 | (let (;; (inhibit-modification-hooks t) | 3701 | (let (;; (inhibit-modification-hooks t) |
| 3702 | before-change-functions after-change-functions) | 3702 | (before-change-functions |
| 3703 | ;; Ugly Hack: if the body uses syntax-ppss/syntax-propertize | ||
| 3704 | ;; (e.g. via a regexp-search or sexp-movement trigerring | ||
| 3705 | ;; on-the-fly syntax-propertize), make sure that this gets | ||
| 3706 | ;; properly refreshed after subsequent changes. | ||
| 3707 | (if (memq #'syntax-ppss-flush-cache before-change-functions) | ||
| 3708 | '(syntax-ppss-flush-cache))) | ||
| 3709 | after-change-functions) | ||
| 3703 | (setq result (funcall body))) | 3710 | (setq result (funcall body))) |
| 3704 | (let ((ap-elt | 3711 | (let ((ap-elt |
| 3705 | (list 'apply | 3712 | (list 'apply |