Tweak `condition-case' keyword highlights
* lisp/emacs-lisp/lisp-mode.el (lisp--el-non-funcall-position-p): Tweak `condition-case' position check to skip the VAR form.
This commit is contained in:
parent
e5aaa1251c
commit
8f28a1b9da
2 changed files with 13 additions and 3 deletions
|
@ -234,8 +234,11 @@
|
||||||
(< pos (point))))
|
(< pos (point))))
|
||||||
(and (eq parent 'condition-case)
|
(and (eq parent 'condition-case)
|
||||||
(progn
|
(progn
|
||||||
(forward-sexp 2)
|
(forward-sexp 1)
|
||||||
(< (point) pos))))))))))
|
;; If we're in the second form, then we're in
|
||||||
|
;; a funcall position.
|
||||||
|
(not (< (point) pos (progn (forward-sexp 1)
|
||||||
|
(point)))))))))))))
|
||||||
|
|
||||||
(defun lisp--el-match-keyword (limit)
|
(defun lisp--el-match-keyword (limit)
|
||||||
;; FIXME: Move to elisp-mode.el.
|
;; FIXME: Move to elisp-mode.el.
|
||||||
|
|
|
@ -877,7 +877,7 @@ to (xref-elisp-test-descr-to-target xref)."
|
||||||
"(\\(if\\)")
|
"(\\(if\\)")
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
(ert-deftest test-elisp-font-keywords-if ()
|
(ert-deftest test-elisp-font-keywords-4 ()
|
||||||
:expected-result :failed ; FIXME bug#43265
|
:expected-result :failed ; FIXME bug#43265
|
||||||
(should (eq (test--font '(condition-case nil
|
(should (eq (test--font '(condition-case nil
|
||||||
(foo)
|
(foo)
|
||||||
|
@ -885,5 +885,12 @@ to (xref-elisp-test-descr-to-target xref)."
|
||||||
"(\\(if\\)")
|
"(\\(if\\)")
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
|
(ert-deftest test-elisp-font-keywords-5 ()
|
||||||
|
(should (eq (test--font '(condition-case (when a)
|
||||||
|
(foo)
|
||||||
|
(error t))
|
||||||
|
"(\\(when\\)")
|
||||||
|
nil)))
|
||||||
|
|
||||||
(provide 'elisp-mode-tests)
|
(provide 'elisp-mode-tests)
|
||||||
;;; elisp-mode-tests.el ends here
|
;;; elisp-mode-tests.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue