GNU bug report logs - #66420
remove the omnipresent 'Services' sub-menu from all pop-up menus (macOS)

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Date: Mon, 9 Oct 2023 12:05:01 UTC

Severity: normal

Done: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66420 in the body.
You can then email your comments to 66420 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#66420; Package emacs. (Mon, 09 Oct 2023 12:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mattias Engdegård <mattias.engdegard <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 09 Oct 2023 12:05:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Emacs Bug Report <bug-gnu-emacs <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>
Subject: remove the omnipresent 'Services' sub-menu from all pop-up menus
 (macOS)
Date: Mon, 9 Oct 2023 14:03:42 +0200
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;





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66420; Package emacs. (Mon, 09 Oct 2023 12:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 66420 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Mattias Engdegård <mattias.engdegard <at> gmail.com>
Cc: 66420 <at> debbugs.gnu.org, Alan Third <alan <at> idiocy.org>
Subject: Re: bug#66420: remove the omnipresent 'Services' sub-menu from all
 pop-up menus (macOS)
Date: Mon, 09 Oct 2023 14:28:34 +0200
Mattias Engdegård <mattias.engdegard <at> gmail.com> writes:

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

I'm all for it :-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66420; Package emacs. (Mon, 09 Oct 2023 12:46:02 GMT) Full text and rfc822 format available.

Message #11 received at 66420 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>, 
 Mattias Engdegård <mattias.engdegard <at> gmail.com>
Cc: 66420 <at> debbugs.gnu.org, Alan Third <alan <at> idiocy.org>
Subject: Re: bug#66420: remove the omnipresent 'Services' sub-menu from all
 pop-up menus (macOS)
Date: Mon, 9 Oct 2023 12:44:40 +0000
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

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

That's also the oldest version of macOS that we support, so that should
be fine.

>> --- 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;
>
> I'm all for it :-)

+1




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66420; Package emacs. (Mon, 09 Oct 2023 15:17:01 GMT) Full text and rfc822 format available.

Message #14 received at 66420 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 66420 <at> debbugs.gnu.org,
 Mattias Engdegård <mattias.engdegard <at> gmail.com>
Subject: Re: bug#66420: remove the omnipresent 'Services' sub-menu from all
 pop-up menus (macOS)
Date: Mon, 9 Oct 2023 16:16:13 +0100
On Mon, Oct 09, 2023 at 12:44:40PM +0000, Stefan Kangas wrote:
> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
> 
> >> The patch below removes it. The property is documented to be
> >> present in macOS 10.6 and above, which is fairly old (Snow
> >> Leopard).
> 
> That's also the oldest version of macOS that we support, so that
> should be fine.

Yeah, I'd suggest removing the check as we don't bother anywhere else
in the code, however it looks like this property isn't available in
GNUstep so probably best to limit it to NS_IMPL_COCOA.
-- 
Alan Third




Reply sent to Mattias Engdegård <mattias.engdegard <at> gmail.com>:
You have taken responsibility. (Mon, 09 Oct 2023 15:44:02 GMT) Full text and rfc822 format available.

Notification sent to Mattias Engdegård <mattias.engdegard <at> gmail.com>:
bug acknowledged by developer. (Mon, 09 Oct 2023 15:44:02 GMT) Full text and rfc822 format available.

Message #19 received at 66420-done <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 66420-done <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#66420: remove the omnipresent 'Services' sub-menu from all
 pop-up menus (macOS)
Date: Mon, 9 Oct 2023 17:42:37 +0200
9 okt. 2023 kl. 17.16 skrev Alan Third <alan <at> idiocy.org>:

> Yeah, I'd suggest removing the check as we don't bother anywhere else
> in the code, however it looks like this property isn't available in
> GNUstep so probably best to limit it to NS_IMPL_COCOA.

Thank you, now done on master.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 07 Nov 2023 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 222 days ago.

Previous Next


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