]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix macro fontification in `condition-case' handler bodies
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 24 Jan 2021 20:43:25 +0000 (21:43 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 24 Jan 2021 20:43:25 +0000 (21:43 +0100)
* 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).

lisp/emacs-lisp/lisp-mode.el
test/lisp/progmodes/elisp-mode-tests.el

index 34ecfd1c25446bd5429670dd8f371eea0607c3ac..9c2b0dbe2004eab586009f5b27017e103d14634e 100644 (file)
                          (forward-sexp 1)
                          (< pos (point))))
                   (and (eq parent 'condition-case)
-                       (progn
-                         (forward-sexp 1)
-                         ;; If we're in the second form, then we're in
-                         ;; a funcall position.
-                         (not (< (point) pos (progn (forward-sexp 1)
-                                                    (point)))))))))))))
+                       ;; If (cdr paren-posns), then we're in the BODY
+                       ;; of HANDLERS.
+                       (and (not (cdr paren-posns))
+                            (progn
+                              (forward-sexp 1)
+                              ;; 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)
   ;; FIXME: Move to elisp-mode.el.
index 714751eafc83f8028dcd4a505434cb03be5d9f36..e84184ff07dfd8105b84e2ab90203e59b2619379 100644 (file)
@@ -864,7 +864,6 @@ to (xref-elisp-test-descr-to-target xref)."
               'nil)))
 
 (ert-deftest test-elisp-font-keywords-2 ()
-  :expected-result :failed ; FIXME bug#43265
   (should (eq (test--font '(condition-case nil
                                (foo)
                              (error (when a b)))