I'm looking for a simple way to make emacs remember of declared variable in a single function in C/C++. By "simple", I mean without any external package, just with some elisp lines in configuration files.
My default Emacs configuration colors variables names in yellow on declaration, but let them white on use.
char toto; // 'char' is green, 'toto' is yellow
toto = 42; // 'toto' is white
I would like to make every "toto" of the same function/scope colored in yellow as well.
I've already looked on this question but I would like something simpler. I also tried to do something with font-lock mode, but I didn't succeed to make something adaptable to variable names.
I already have an idea for C++ class member names (using a name pattern), so I just want a local variable match here.