My first attempt for this fix was actually this patch
+ :set (lambda (sym val)
+ ;; TODO: Maybe add a condition here using last value of sym
+ (keymap-unset flymake-mode-map "<left-margin> <mouse-1>" t)
+ (keymap-unset flymake-mode-map "<left-fringe> <mouse-1>" t)
+ (set-default sym val)
+ (when val
+ (keymap-set flymake-mode-map
+ (key-description `[,(pcase flymake-indicator-type
+ ('fringes flymake-fringe-indicator-position)
+ ('margins
flymake-margin-indicator-position))
+ mouse-1])
+ #'flymake-show-buffer-diagnostics))))
Thanks, this is much better.
But for some reason it didn't work.
Maybe it doesn't work because flymake-mode still uses an old map,
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?
BTW!! When I haven't seen the code yet, I was actually looking for a
property in the margin char, I thought that the char in the
fringe/margin had a 'keymap property that made it clickable.
That would give more fine grained actions and will allow a more precise
action. I tried to do that but it didn't work, apparently the action is
associated with the whole margin.
What would happen when you delete the char with the 'keymap' property?
The indicator will go away? This doesn't look right.