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: Sun, 19 Jan 2025 21:47:16 +0100
User-agent: K-9 Mail for Android

Hi Juri:

On January 19, 2025 7:51:42 PM GMT+01:00, Juri Linkov <juri@linkov.net> 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,
But the map value seems to be right. And if I set some other binding it seems 
to work there.

>so you need to reevaluate flymake-mode to take a new value of the 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?
>
That's way beyond my elisp capabilities ;)

>> 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.

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.


reply via email to

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