In some projects I'm working with, there are coding rules that don't allow C++ operators such as
== (for fear of being confused with
= I suppose, but oh well...). Instead, special macros such as
_EQ_ have to be inserted, which
==. There are other
#defines as well, such as
_BITAND_ and so on.
Needless to say, this is all quite tedious to write and I would love to have a meachanism that makes me type
== as I'm used to and have it automatically replaced by
abbrev-mode, but as this answer explains, abbrevs can only be defined for words, and I don't really want to change the definition all the required syntax entries. Also, it would be nice if I don't have to type a space after the keyword, but have the macro appear as soon as I hit the last char of the "forbidden" sequence.
Is there any way to achieve this, maybe a "more aggressive" abbrev-mode or some package?
EDIT: Here are some replacements that need to be performed:
I type: I want: = = (works with key-combo) == _EQ_ (works with key-combo) & _BITAND_ (works with key-combo) && _AND_ (works with key-combo) | _BITOR_ (works with key-combo) || _OR_ (works with key-combo) ! _NOT_ (works with key-combo) != _NOT_EQ_ (doesn't work with key-combo)