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

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

bug#62250: 29.0.60; Allow context menu from text properties to not overr


From: Augusto Stoffel
Subject: bug#62250: 29.0.60; Allow context menu from text properties to not override everything
Date: Sat, 18 Mar 2023 08:51:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

It would be nice if the context menu defined by a text property had the
option of adding to instead of overriding the menu specified by
`context-menu-functions'.

I think this can be done in a backwards-compatible way as follows:

--8<---------------cut here---------------start------------->8---
(defun context-menu-map (&optional click)
  "Return menu map constructed for context near mouse CLICK.
The menu is populated by calling functions from
`context-menu-functions'.  Each function receives the menu and the mouse
click event and returns the same menu after adding own menu items to the
composite menu.  Alternatively, it can return a completely new menu.  In
this case, no further functions from `context-menu-functions' are
called.

When there is a text property `context-menu-function' at CLICK, it is
handled as if it were the first entry of `context-menu-functions'.

At the end, it's possible to modify the final menu by specifying the
function `context-menu-filter-function'."
--8<---------------cut here---------------end--------------->8---





reply via email to

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