diff options
| author | Eli Zaretskii | 2018-09-15 12:21:12 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2018-09-15 12:21:12 +0300 |
| commit | e133b630625d6e5791c8b491c1cf3252cdb97080 (patch) | |
| tree | 60821cda0ecd1ee76e5f5ae044471d48c19a8dfd /test/src | |
| parent | cc8f334d2da736be8935f5abae51f7b1f992b343 (diff) | |
| download | emacs-e133b630625d6e5791c8b491c1cf3252cdb97080.tar.gz emacs-e133b630625d6e5791c8b491c1cf3252cdb97080.zip | |
Avoid adverse side effects of fixing bug#21824
* test/src/buffer-tests.el
(overlay-modification-hooks-deleted-overlay): New test.
* src/buffer.c (report_overlay_modification): Don't bypass all
the overlay-modification hooks; instead, invoke each function
only if the buffer associated with the overlay is the current
buffer. (Bug#30823)
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/buffer-tests.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index f9c477fbfd7..8479bbdda0b 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el | |||
| @@ -45,6 +45,25 @@ with parameters from the *Messages* buffer modification." | |||
| 45 | (should (eq buf (current-buffer)))) | 45 | (should (eq buf (current-buffer)))) |
| 46 | (when msg-ov (delete-overlay msg-ov)))))) | 46 | (when msg-ov (delete-overlay msg-ov)))))) |
| 47 | 47 | ||
| 48 | (ert-deftest overlay-modification-hooks-deleted-overlay () | ||
| 49 | "Test for bug#30823." | ||
| 50 | (let ((check-point nil) | ||
| 51 | (ov-delete nil) | ||
| 52 | (ov-set nil)) | ||
| 53 | (with-temp-buffer | ||
| 54 | (insert "abc") | ||
| 55 | (setq ov-set (make-overlay 1 3)) | ||
| 56 | (overlay-put ov-set 'modification-hooks | ||
| 57 | (list (lambda (_o after &rest _args) | ||
| 58 | (and after (setq check-point t))))) | ||
| 59 | (setq ov-delete (make-overlay 1 3)) | ||
| 60 | (overlay-put ov-delete 'modification-hooks | ||
| 61 | (list (lambda (o after &rest _args) | ||
| 62 | (and (not after) (delete-overlay o))))) | ||
| 63 | (goto-char 2) | ||
| 64 | (insert "1") | ||
| 65 | (should (eq check-point t))))) | ||
| 66 | |||
| 48 | (ert-deftest test-generate-new-buffer-name-bug27966 () | 67 | (ert-deftest test-generate-new-buffer-name-bug27966 () |
| 49 | (should-not (string-equal "nil" | 68 | (should-not (string-equal "nil" |
| 50 | (progn (get-buffer-create "nil") | 69 | (progn (get-buffer-create "nil") |