I know by M-x set-background-color
or M-x set-foreground-color
one can change the background/foreground of the the entire buffer. Of course this color change only persists in the current session.
In the same way how can one change the background/foreground color of some characters/words?
For example if in a buffer I have something like below
I would like to change the background/foreground color of some characters like below:
And I would like that this color change to be persistent in the current session unless I delete these colorful character.