emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 196be2b: Fix macro fontification in `condition-case' handler bodi


From: Lars Ingebrigtsen
Subject: master 196be2b: Fix macro fontification in `condition-case' handler bodies
Date: Sun, 24 Jan 2021 15:43:42 -0500 (EST)

branch: master
commit 196be2bf12e1018335e4261cd4d6f25d6d16c415
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/emacs-lisp/lisp-mode.el            | 15 +++++++++------
 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 34ecfd1..9c2b0db 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -233,12 +233,15 @@
                          (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.
diff --git a/test/lisp/progmodes/elisp-mode-tests.el 
b/test/lisp/progmodes/elisp-mode-tests.el
index 714751e..e84184f 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)."
               '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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]