all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#62250: 29.0.60; Allow context menu from text properties to not override everything
@ 2023-03-18  7:51 Augusto Stoffel
  2023-03-18  8:31 ` Eli Zaretskii
  2023-03-18 18:08 ` Juri Linkov
  0 siblings, 2 replies; 18+ messages in thread
From: Augusto Stoffel @ 2023-03-18  7:51 UTC (permalink / raw)
  To: 62250; +Cc: Juri Linkov

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





^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-03-05 16:51 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-18  7:51 bug#62250: 29.0.60; Allow context menu from text properties to not override everything Augusto Stoffel
2023-03-18  8:31 ` Eli Zaretskii
2023-03-18 11:19   ` Augusto Stoffel
2023-03-18 11:24     ` Eli Zaretskii
2023-03-18 11:29       ` Augusto Stoffel
2023-03-18 11:33         ` Eli Zaretskii
2023-03-18 18:10     ` Juri Linkov
2023-03-18 18:44       ` Augusto Stoffel
2023-03-19 17:40         ` Juri Linkov
2023-03-19 18:10           ` Augusto Stoffel
2023-03-20 18:29             ` Juri Linkov
2023-03-18 18:08 ` Juri Linkov
2023-03-18 18:39   ` Augusto Stoffel
2023-03-19 17:43     ` Juri Linkov
2023-03-19 18:21       ` Augusto Stoffel
2023-03-20 18:34         ` Juri Linkov
2023-04-02 16:35       ` Juri Linkov
2024-03-05 16:51         ` Juri Linkov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.