With a C like language, it might be nice to be able to display:
(var * t) as (var x t) - using the unicode multiply symbol.

However this causes problems with casting. eg:
void fn(MyStruct *s) becomes void fn(MyStruct xs).

Is there a way to only replace a symbol when its surrounded by white-space? 1

Matching " * " works but removes the spaces on either side.

  1. Am aware spacing in this context is just a convention, nevertheless, would be interested to know if its possible.
  • 1
    If you write your own font-lock rule, you can match " \\(\\*\\) " and supply a "face expression" that apply compose-region as a side effect to match number 1. Note that the face expression should return nil. (If anybody want to write up an answer based on this, feel free to do so.) – Lindydancer Jan 3 '17 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.