GNU bug report logs - #50067
Context menus

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 15 Aug 2021 08:52:01 UTC

Severity: normal

Tags: fixed

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50067 <at> debbugs.gnu.org
Subject: bug#50067: Context menus
Date: Mon, 16 Aug 2021 13:31:58 +0200
Juri Linkov <juri <at> linkov.net> writes:

>> +(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]

[...]

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

Could just use `last-input-event', I guess?  But that doesn't really
give us anything better than what we have, so there's probably no point.

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

Right.  I was thinking that it's pretty likely that all button-like
things are going to grow a context menu, but we can add `context-menu'
later if that turns out to be the case.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.