unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#66420: remove the omnipresent 'Services' sub-menu from all pop-up menus (macOS)
@ 2023-10-09 12:03 Mattias Engdegård
  2023-10-09 12:28 ` Gerd Möllmann
  0 siblings, 1 reply; 5+ messages in thread
From: Mattias Engdegård @ 2023-10-09 12:03 UTC (permalink / raw)
  To: 66420; +Cc: Alan Third

On macOS, once a selection has been made, every pop-up menu includes a 'Services' sub-menu from then on.
It contains items such as 'Search with Google' and 'Add to Music as a Spoken Track'.
It's always completely out of place and very annoying.

The buffer menu? It's there. Any menu activated by clicking on the mode line? It's there. Selecting a value in variable customisation? It's there.

The only place where it might be remotely appropriate is the context-menu-mode menu, if enabled, but then only if we actually have an active selection. I'm going to ignore this for the time being since it's much less important than getting rid of it where it doesn't belong.

The patch below removes it. The property is documented to be present in macOS 10.6 and above, which is fairly old (Snow Leopard).

--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -768,6 +768,9 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
                             pressure: 0];
 
   context_menu_value = -1;
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
+  self.allowsContextMenuPlugIns = NO;
+#endif
   [NSMenu popUpContextMenu: self withEvent: event forView: view];
   retVal = context_menu_value;
   context_menu_value = 0;






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

end of thread, other threads:[~2023-10-09 15:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-09 12:03 bug#66420: remove the omnipresent 'Services' sub-menu from all pop-up menus (macOS) Mattias Engdegård
2023-10-09 12:28 ` Gerd Möllmann
2023-10-09 12:44   ` Stefan Kangas
2023-10-09 15:16     ` Alan Third
2023-10-09 15:42       ` Mattias Engdegård

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).