Thanks, this is much better.
Maybe it doesn't work because flymake-mode still uses an old map,
But the map value seems to be right. And if I set some other binding it seems
to work there.
The real problem is that this change requires substantial refactoring
of flymake.el to be able to compile the change above. You need to add
a setter-function like 'flymake-indicator-type--set' defined before
the defcustom flymake-indicator-type. But all variables that it uses
(flymake-fringe-indicator-position, flymake-margin-indicator-position,
flymake-mode-map) should be defined earlier, etc.
But this is not the right thing to do anyway. Then maybe you could use
a keymap filter with the condition that checks flymake-indicator-type?
That's way beyond my elisp capabilities ;)
You can see an example in outline-minor-mode-cycle--bind.
A keymap :filter could help to avoid refactoring.
What would happen when you delete the char with the 'keymap' property?
The indicator will go away? This doesn't look right.
I don't get what you mean or maybe I didn't explain myself properly.
I thought to make clickable the ! or !! characters in the margins.
The user does not remove that char, flymake does. If the char goes
away it means that the error is gone so, the action is not needed.
I meant to make the !! a clickable text itself so (for example) we
could make that a click on one of those goes directly to that error in
the list.
Sorry, I thought about the 'keymap' property on a char in the buffer,
not in the margin. So adding the property on a char in the margin
would be an improvement.