emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix mouse click on flymake


From: Ergus
Subject: Re: [PATCH] Fix mouse click on flymake
Date: Mon, 20 Jan 2025 00:29:04 +0100

On Sun, Jan 19, 2025 at 08:51:42PM +0200, Juri Linkov wrote:
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,


so you need to reevaluate flymake-mode to take a new value of the map.
I just tried this and it doesn't work either. Some other idea?


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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]