From: Philipp Stephani <p.stephani2@gmail.com>
To: emacs-devel@gnu.org
Cc: Philipp Stephani <phst@google.com>
Subject: [PATCH 11/13] Clean up code around 'ns-list-services'
Date: Sat, 20 May 2017 16:58:39 +0200 [thread overview]
Message-ID: <20170520145841.94282-11-phst@google.com> (raw)
In-Reply-To: <20170520145841.94282-1-phst@google.com>
* src/nsfns.m (Fns_list_services): Remove unreachable code. In this
branch NS_IMPL_COCOA cannot be defined.
(interpret_services_menu): Define only if called to avoid compiler
warnings about unused static functions.
---
src/nsfns.m | 32 ++------------------------------
1 file changed, 2 insertions(+), 30 deletions(-)
diff --git a/src/nsfns.m b/src/nsfns.m
index cbe0ffb858..31b2f762e0 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -175,6 +175,7 @@ Updated by Christian Limpach (chris@nice.ch)
#endif
}
+#ifndef NS_IMPL_COCOA
static Lisp_Object
interpret_services_menu (NSMenu *menu, Lisp_Object prefix, Lisp_Object old)
/* --------------------------------------------------------------------------
@@ -223,7 +224,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
}
return old;
}
-
+#endif
/* ==========================================================================
@@ -2107,9 +2108,6 @@ and GNUstep implementations ("distributor-specific release
#else
Lisp_Object ret = Qnil;
NSMenu *svcs;
-#ifdef NS_IMPL_COCOA
- id delegate;
-#endif
check_window_system (NULL);
svcs = [[NSMenu alloc] initWithTitle: @"Services"];
@@ -2117,33 +2115,7 @@ and GNUstep implementations ("distributor-specific release
[NSApp registerServicesMenuSendTypes: ns_send_types
returnTypes: ns_return_types];
-/* On Tiger, services menu updating was made lazier (waits for user to
- actually click on the menu), so we have to force things along: */
-#ifdef NS_IMPL_COCOA
- delegate = [svcs delegate];
- if (delegate != nil)
- {
- if ([delegate respondsToSelector: @selector (menuNeedsUpdate:)])
- [delegate menuNeedsUpdate: svcs];
- if ([delegate respondsToSelector:
- @selector (menu:updateItem:atIndex:shouldCancel:)])
- {
- int i, len = [delegate numberOfItemsInMenu: svcs];
- for (i =0; i<len; i++)
- [svcs addItemWithTitle: @"" action: NULL keyEquivalent: @""];
- for (i =0; i<len; i++)
- if (![delegate menu: svcs
- updateItem: (NSMenuItem *)[svcs itemAtIndex: i]
- atIndex: i shouldCancel: NO])
- break;
- }
- }
-#endif
-
[svcs setAutoenablesItems: NO];
-#ifdef NS_IMPL_COCOA
- [svcs update]; /* on macOS, converts from '/' structure */
-#endif
ret = interpret_services_menu (svcs, Qnil, ret);
return ret;
--
2.13.0
next prev parent reply other threads:[~2017-05-20 14:58 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-20 14:58 [PATCH 01/13] Nextstep: Use instancetype explicit return type Philipp Stephani
2017-05-20 14:58 ` [PATCH 02/13] Declare Nextstep unexec functions in lisp.h Philipp Stephani
2017-05-20 14:58 ` [PATCH 03/13] Remove unused function print_regions Philipp Stephani
2017-05-20 14:58 ` [PATCH 04/13] Use NSCharacterCollection instead of CTCharacterCollection Philipp Stephani
2017-05-20 14:58 ` [PATCH 05/13] Make a function static that isn't used outside this file Philipp Stephani
2017-05-20 14:58 ` [PATCH 06/13] Remove calls to deprecated setUsesScreenFonts Philipp Stephani
2017-05-20 14:58 ` [PATCH 07/13] Remove trailing semicolons in method definitions Philipp Stephani
2017-05-20 14:58 ` [PATCH 08/13] Nextstep: remove some deprecated method calls Philipp Stephani
2017-05-20 14:58 ` [PATCH 09/13] Nextstep: Replace deprecated enumerators Philipp Stephani
2017-05-20 14:58 ` [PATCH 10/13] Remove unused automatic variables Philipp Stephani
2017-05-20 14:58 ` Philipp Stephani [this message]
2017-05-20 14:58 ` [PATCH 12/13] Fix call of registerServicesMenuSendTypes Philipp Stephani
2017-05-20 14:58 ` [PATCH 13/13] Avoid uninitialized read Philipp Stephani
2017-05-21 15:30 ` John Wiegley
2017-05-20 20:23 ` [PATCH 01/13] Nextstep: Use instancetype explicit return type Paul Eggert
2017-05-20 22:45 ` mituharu
2017-05-21 20:00 ` Philipp Stephani
2017-05-22 2:36 ` Paul Eggert
2017-05-22 19:21 ` [PATCH] Fix GNUstep build Alan Third
2017-05-23 9:46 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170520145841.94282-11-phst@google.com \
--to=p.stephani2@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=phst@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).