GNU bug report logs -
#62157
More control over the mouse behaviour in eglot
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 11 Sep 2023 17:22:41 -0700
with message-id <CADwFkmn6ppD-EX4JQNhEjOUp-NyW9OFeGo-VpqBb5fTZh5tjnw <at> mail.gmail.com>
and subject line Re: bug#62157: More control over the mouse behaviour in eglot
has caused the debbugs.gnu.org bug report #62157,
regarding More control over the mouse behaviour in eglot
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
62157: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62157
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
When I edit Python with eglot, mouse-1-down opens the eglot code
actions menu when over a place where there is a possible action. I'd
like to be able to define the mouse event to open the menu myself. In
the same line, I'd like to control the items on the code actions mouse
menu.
--
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler
Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should
run a leader-deposed hook here, but we can't yet
[Message part 3 (message/rfc822, inline)]
João Távora <joaotavora <at> gmail.com> writes:
> On Mon, Mar 13, 2023 at 7:22 AM Pedro Andres Aranda Gutierrez
> <paaguti <at> gmail.com> wrote:
>>
>> When I edit Python with eglot, mouse-1-down opens the eglot code
>> actions menu when over a place where there is a possible action. I'd
>> like to be able to define the mouse event to open the menu myself. In
>> the same line, I'd like to control the items on the code actions mouse
>> menu.
>
> These are two separate requests. I'll focus on the first one,
> as the second one is obscure. It probablyneeds its own separate
> issue describing a reproducible observable example of what "item
> control" is desired.
>
> So, having mouse-1 for the binding to get code actions in diagnostics
> is indeed not good, because it prevents point from being put on
> a certain character using mouse-1, which should really nothappen.
>
> Currently, to configure it, the user must place a certain property on
> the symbols eglot-note eglot-warning eglot-error, which is not
> easy at all.
>
> Can you try this patch? It also changes the default binding to
> [mouse-2].
>
> diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
> index 2491c86ea5b..256b4cd93ba 100644
> --- a/lisp/progmodes/eglot.el
> +++ b/lisp/progmodes/eglot.el
> @@ -2084,15 +2084,18 @@ eglot--mode-line-format
> (defalias 'eglot--make-diag 'flymake-make-diagnostic)
> (defalias 'eglot--diag-data 'flymake-diagnostic-data)
>
> +(defvar eglot-diagnostics-map
> + "Map active in Eglot-backed Flymake diagnostic overlays."
> + (let ((map (make-sparse-keymap)))
> + (define-key map [mouse-1] 'eglot-code-actions-at-mouse)
> + map))
> +
> (cl-loop for i from 1
> for type in '(eglot-note eglot-warning eglot-error)
> do (put type 'flymake-overlay-control
> `((mouse-face . highlight)
> (priority . ,(+ 50 i))
> - (keymap . ,(let ((map (make-sparse-keymap)))
> - (define-key map [mouse-1]
> - (eglot--mouse-call
> 'eglot-code-actions))
> - map)))))
> + (keymap . ,eglot-diagnostics-map))))
>
>
> ;;; Protocol implementation (Requests, notifications, etc)
> @@ -3335,6 +3338,9 @@ eglot-code-actions
> (eglot--read-execute-code-action actions server action-kind)
> actions)))
>
> +(defalias 'eglot-code-actions-at-mouse (eglot--mouse-call 'eglot-code-actions)
> + "Like `eglot-code-actions', but intended for mouse events.")
> +
> (defun eglot--read-execute-code-action (actions server &optional action-kind)
> "Helper for interactive calls to `eglot-code-actions'."
> (let* ((menu-items
>
> João
It seems like the fix was the patch above, which IIUC has been
installed. I'm therefore closing this bug report.
If this conclusion is incorrect and this is still an issue, please reply
to this email (use "Reply to all" in your email client) and we can
reopen the bug report.
This bug report was last modified 1 year and 252 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.