diff options
| author | Lars Ingebrigtsen | 2021-01-24 21:43:25 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-01-24 21:43:25 +0100 |
| commit | 196be2bf12e1018335e4261cd4d6f25d6d16c415 (patch) | |
| tree | 47512019da348b57513826a708a3fb27a656c407 | |
| parent | 8f28a1b9da06a12ac3631de38119d8845f14499c (diff) | |
| download | emacs-196be2bf12e1018335e4261cd4d6f25d6d16c415.tar.gz emacs-196be2bf12e1018335e4261cd4d6f25d6d16c415.zip | |
Fix macro fontification in `condition-case' handler bodies
* lisp/emacs-lisp/lisp-mode.el (lisp--el-non-funcall-position-p):
Fontify macros in the BODY of HANDLERS in `condition-case'
correctly (bug#43265).
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 15 | ||||
| -rw-r--r-- | test/lisp/progmodes/elisp-mode-tests.el | 1 |
2 files changed, 9 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 34ecfd1c254..9c2b0dbe200 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -233,12 +233,15 @@ | |||
| 233 | (forward-sexp 1) | 233 | (forward-sexp 1) |
| 234 | (< pos (point)))) | 234 | (< pos (point)))) |
| 235 | (and (eq parent 'condition-case) | 235 | (and (eq parent 'condition-case) |
| 236 | (progn | 236 | ;; If (cdr paren-posns), then we're in the BODY |
| 237 | (forward-sexp 1) | 237 | ;; of HANDLERS. |
| 238 | ;; If we're in the second form, then we're in | 238 | (and (not (cdr paren-posns)) |
| 239 | ;; a funcall position. | 239 | (progn |
| 240 | (not (< (point) pos (progn (forward-sexp 1) | 240 | (forward-sexp 1) |
| 241 | (point))))))))))))) | 241 | ;; If we're in the second form, then we're in |
| 242 | ;; a funcall position. | ||
| 243 | (not (< (point) pos (progn (forward-sexp 1) | ||
| 244 | (point)))))))))))))) | ||
| 242 | 245 | ||
| 243 | (defun lisp--el-match-keyword (limit) | 246 | (defun lisp--el-match-keyword (limit) |
| 244 | ;; FIXME: Move to elisp-mode.el. | 247 | ;; FIXME: Move to elisp-mode.el. |
diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index 714751eafc8..e84184ff07d 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el | |||
| @@ -864,7 +864,6 @@ to (xref-elisp-test-descr-to-target xref)." | |||
| 864 | 'nil))) | 864 | 'nil))) |
| 865 | 865 | ||
| 866 | (ert-deftest test-elisp-font-keywords-2 () | 866 | (ert-deftest test-elisp-font-keywords-2 () |
| 867 | :expected-result :failed ; FIXME bug#43265 | ||
| 868 | (should (eq (test--font '(condition-case nil | 867 | (should (eq (test--font '(condition-case nil |
| 869 | (foo) | 868 | (foo) |
| 870 | (error (when a b))) | 869 | (error (when a b))) |