> Indeed, I assumed that I was creating new strings because (eq " " " ")
> is nil.
Your test can return nil even if new strings aren't created at runtime
(e.g. because each source code string gets its own runtime string).
It may be nil in your test, but it may also return t (I think if you
byte-compile your test it will return t).
>> > (let ((s " "))
Here you have a single " " string in your source code. And no it's not
recreated each time, it will be the same one reused everytime (and
modified by `put-text-property`).
You can use `propertize` instead.
Stefan