diff options
| author | Noam Postavsky | 2019-06-05 19:24:58 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-06-05 20:30:23 -0400 |
| commit | da118e6a7c5d1d1d07fd186b0ae5e60340ac9dca (patch) | |
| tree | 932423461bb4df20c46b50ffbf0c96c74ddf49d8 /test | |
| parent | 610fb73ab6d7a22b722f523d6ebc4aa8fa1db7c9 (diff) | |
| download | emacs-da118e6a7c5d1d1d07fd186b0ae5e60340ac9dca.tar.gz emacs-da118e6a7c5d1d1d07fd186b0ae5e60340ac9dca.zip | |
Keep nxml prolog updated via syntax-propertize
Instead of using after-change-functions. Also, stop consulting
nxml-prolog-regions during syntax-propertize. It turns out the
problems fixed by using prolog information are actually due to using
the wrong syntax table during propertizing. This was fixed in
2019-06-04 "* lisp/emacs-lisp/syntax.el: Use syntax-ppss-table for
syntax-propertize." so consulting the prolog data is no longer needed.
* lisp/nxml/nxml-rap.el (nxml-maybe-rescan-prolog): Remove.
* lisp/nxml/nxml-mode.el (nxml-mode): Stop using it.
(nxml-syntax-propertize): Don't use nxml-prolog-regions, just call
nxml-scan-prolog if needed before delegating to
sgml-syntax-propertize.
* test/lisp/nxml/nxml-mode-tests.el (nxml-mode-edit-prolog): New test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/nxml/nxml-mode-tests.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lisp/nxml/nxml-mode-tests.el b/test/lisp/nxml/nxml-mode-tests.el index 53416b4280c..e9b4fb7c7e1 100644 --- a/test/lisp/nxml/nxml-mode-tests.el +++ b/test/lisp/nxml/nxml-mode-tests.el | |||
| @@ -114,5 +114,23 @@ | |||
| 114 | (should (= 1 (- (car (syntax-ppss (1- (point-max)))) | 114 | (should (= 1 (- (car (syntax-ppss (1- (point-max)))) |
| 115 | (car (syntax-ppss (point-max)))))))) | 115 | (car (syntax-ppss (point-max)))))))) |
| 116 | 116 | ||
| 117 | (ert-deftest nxml-mode-edit-prolog () | ||
| 118 | "Test for Bug#23668." | ||
| 119 | (with-temp-buffer | ||
| 120 | (insert " | ||
| 121 | <t> | ||
| 122 | <sub/> | ||
| 123 | </t>") | ||
| 124 | (nxml-mode) | ||
| 125 | ;; The leading "\n " before "<t>" is the prolog, indenting will | ||
| 126 | ;; delete the space hence changing the prolog size. If that is | ||
| 127 | ;; not taken into account, then the <sub/> tag won't be indented | ||
| 128 | ;; correctly. | ||
| 129 | (indent-region (point-min) (point-max)) | ||
| 130 | (should (equal (buffer-string) " | ||
| 131 | <t> | ||
| 132 | <sub/> | ||
| 133 | </t>")))) | ||
| 134 | |||
| 117 | (provide 'nxml-mode-tests) | 135 | (provide 'nxml-mode-tests) |
| 118 | ;;; nxml-mode-tests.el ends here | 136 | ;;; nxml-mode-tests.el ends here |