emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#62157: closed (More control over the mouse behaviour in eglot)


From: GNU bug Tracking System
Subject: bug#62157: closed (More control over the mouse behaviour in eglot)
Date: Tue, 12 Sep 2023 00:23:02 +0000

Your message dated Mon, 11 Sep 2023 17:22:41 -0700
with message-id 
<CADwFkmn6ppD-EX4JQNhEjOUp-NyW9OFeGo-VpqBb5fTZh5tjnw@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@gnu.org.)


-- 
62157: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62157
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: More control over the mouse behaviour in eglot Date: Mon, 13 Mar 2023 08:20:48 +0100
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



--- End Message ---
--- Begin Message --- Subject: Re: bug#62157: More control over the mouse behaviour in eglot Date: Mon, 11 Sep 2023 17:22:41 -0700
João Távora <joaotavora@gmail.com> writes:

> On Mon, Mar 13, 2023 at 7:22 AM Pedro Andres Aranda Gutierrez
> <paaguti@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.


--- End Message ---

reply via email to

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