From: Yuan Fu Date: Thu, 2 May 2024 04:21:00 +0000 (-0700) Subject: Fix fontification for else in macro body in rust-ts-mode X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=991f9ae2e4fd6092f350c991a63b4762e5f771fb;p=emacs.git Fix fontification for else in macro body in rust-ts-mode * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings): Add a rule for else in macro body. Also added the same rule for "in" and "move" keyword, as they seems to have the same problem. (cherry picked from commit 07c47ea002b4702285bbf467ec09c9b281eb19b7) --- diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index 25f1df4a9f9..7bc05898d15 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -213,7 +213,11 @@ to be checked as its standard input." :language 'rust :feature 'keyword - `([,@rust-ts-mode--keywords] @font-lock-keyword-face) + `([,@rust-ts-mode--keywords] @font-lock-keyword-face + ;; If these keyword are in a macro body, they're marked as + ;; identifiers. + ((identifier) @font-lock-keyword-face + (:match ,(rx (or "else" "in" "move")) @font-lock-keyword-face))) :language 'rust :feature 'number