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

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

bug#50067: Context menus


From: Juri Linkov
Subject: bug#50067: Context menus
Date: Sun, 15 Aug 2021 19:12:57 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> I haven't tested the branch, but reading the diff, it looks like an
> excellent feature to me.  Looking at the implementation of the stuff in
> various modes, I'm wondering whether the interface should perhaps be
> tweaked a bit:
>
> +(defun eww-context-menu (menu)
> [...]
> +  (when (or (mouse-posn-property (event-start last-input-event) 'shr-url)
> +            (mouse-posn-property (event-start last-input-event) 'image-url))
> +    (define-key menu [shr-mouse-browse-url-new-window]
>
> Perhaps the signature of the context menu functions should be:
>
> +(defun eww-context-menu (menu event)
>
> ?

To get an event would be nice, but I see no way to do this.
The top function 'context-menu-map' is called by:

  `(menu-item ,(purecopy "Context Menu") ignore
              :filter (lambda (_) (context-menu-map))))

that has no access to the event - an unused argument of lambda above
is just the binding that is 'ignore' in this case.

> I'm also wondering whether we should add a `context-menu' text property.

As soon as such a need arises, a text property could be added as well.
But it seems currently much cleaner is to use a single context-menu
function for every mode.





reply via email to

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