I wanted to upgrade to emacs 28 to get f-strings support in python but the font-lock.... seem to be all messed up.

Sometimes it works as in the past but sometimes it doesn't like why is post_split_val_size not orange but the line below it is. This is inconsistent across all files, so not sure what is going on but checking if it is my setup only or an emacs 28 issue (: enter image description here

  • You should paste your code rather than just provide a screenshot. Commented Mar 25, 2022 at 1:04

1 Answer 1


Usually, this is because font-lock does not recognize the item as being in one of its categories. You can check this by putting point on the variable and going to Options->Customize Emacs->Specific Face. In the minibuffer, you'll be offered the name of the face under point and the option to customize it.

However, I just checked my own python code, and it has the same issue as yours. I'm using LSP-Jedi. Are you using something like that? The text under point is lsp-face-highlight-textual. I guess I'll have to disconnect the server and see what that does.

EDIT: In my implementation, after getting rid of LSP & friends, the errant elements are not font-locked, they are unidentified. The properly formatted elements are font-lock-variable-name. This does look like a bug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.