Closed charliesneath closed 4 years ago
Hello,
your proposal looks interesting. However, I don't know that much the offered possibilities of the various python modes.Thus, to help me see if it's feasible or no, could you send us a minimal example (some line of valid python code) containing your exemple, and the name of the python mode you are using (I know there is a bunch of them in the wild)?
Thank you very much.
In the following line, I am proposing that the word "TODO" (and possibly other keywords) are highlighted in to stand-out from the comment color:
# TODO: This is a comment, can we highlight the first word?
Here's an example of the syntax highlighting I'm describing for JavaScript (source):
I don't think this is an issue, but worth noting that there was an official PEP that was refused focused on this topic. More information here.
Also, I'm not sure how to find the name of the Python mode I'm using, but my Mode Line says Python ARev company ElDoc
. Let me know where I can find this and I'll update. Thank you!
Hi,
After quick investigation, it's not a native feature of Emacs. However there is a lot of packages, which enable the colorization of such keywords. I let you decide, which is best for you.
I just test quickly the package hl-todo
, customized as follow and it seems to do exactly what you want:
(with-eval-after-load 'hl-todo
(setq hl-todo-keyword-faces
'(("TODO" . 'font-lock-constant-face)
("FIXME" . 'font-lock-warning-face))))
(global-hl-todo-mode)
This is great, thank you for investigating! Appreciate your help.
In Python, I often use comments in the basic form of
# TODO: A note to myself
to identify places in my code that I'd like to update later.I've seen syntax highlighting for this pattern in other themes, but would love to have it for Dracula as well.
It seems similar to how the Dracula theme automatically highlights any bracketed strings in commit messages, i.e
[WIP] note about this commit
.