diff options
| author | Tom Tromey | 2017-11-25 12:11:21 -0700 |
|---|---|---|
| committer | Tom Tromey | 2017-11-25 13:25:37 -0700 |
| commit | cfa2a944d4cf62f16c177398226b17aad88bb5c6 (patch) | |
| tree | 28c8ea046ad2e2042b175a3fb5dfd49a72d19e04 | |
| parent | a8664cc9986be3a7d0ff4c46546ea1d9c906ab00 (diff) | |
| download | emacs-cfa2a944d4cf62f16c177398226b17aad88bb5c6.tar.gz emacs-cfa2a944d4cf62f16c177398226b17aad88bb5c6.zip | |
Change font-lock-extend-region-multiline handling in mhtml-mode
Bug#29159
* lisp/textmodes/mhtml-mode.el (mhtml-mode): Remove
font-lock-extend-region-multiline from
font-lock-extend-region-functions.
(mhtml--extend-font-lock-region): Call font-lock-extend-region-multiline.
| -rw-r--r-- | lisp/textmodes/mhtml-mode.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/textmodes/mhtml-mode.el b/lisp/textmodes/mhtml-mode.el index 8df251276b5..09da155f487 100644 --- a/lisp/textmodes/mhtml-mode.el +++ b/lisp/textmodes/mhtml-mode.el | |||
| @@ -198,6 +198,12 @@ smallest." | |||
| 198 | (get-text-property orig-end 'mhtml-submode)) | 198 | (get-text-property orig-end 'mhtml-submode)) |
| 199 | (cl-decf font-lock-end))) | 199 | (cl-decf font-lock-end))) |
| 200 | 200 | ||
| 201 | ;; Also handle the multiline property -- but handle it here, and | ||
| 202 | ;; not via font-lock-extend-region-functions, to avoid the | ||
| 203 | ;; situation where the two extension functions disagree. | ||
| 204 | ;; See bug#29159. | ||
| 205 | (font-lock-extend-region-multiline) | ||
| 206 | |||
| 201 | (or (/= font-lock-beg orig-beg) | 207 | (or (/= font-lock-beg orig-beg) |
| 202 | (/= font-lock-end orig-end)))) | 208 | (/= font-lock-end orig-end)))) |
| 203 | 209 | ||
| @@ -365,8 +371,7 @@ the rules from `css-mode'." | |||
| 365 | (setq-local font-lock-fontify-region-function | 371 | (setq-local font-lock-fontify-region-function |
| 366 | #'mhtml--submode-fontify-region) | 372 | #'mhtml--submode-fontify-region) |
| 367 | (setq-local font-lock-extend-region-functions | 373 | (setq-local font-lock-extend-region-functions |
| 368 | '(mhtml--extend-font-lock-region | 374 | '(mhtml--extend-font-lock-region)) |
| 369 | font-lock-extend-region-multiline)) | ||
| 370 | 375 | ||
| 371 | ;; Attach this to both pre- and post- hooks just in case it ever | 376 | ;; Attach this to both pre- and post- hooks just in case it ever |
| 372 | ;; changes a key binding that might be accessed from the menu bar. | 377 | ;; changes a key binding that might be accessed from the menu bar. |