From: Philipp Stephani Date: Sat, 20 May 2017 14:55:00 +0000 (+0200) Subject: Clean up code around 'ns-list-services' X-Git-Tag: emacs-26.0.90~521^2~314 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6dd94bcc6b44ee06917d76d638120eca2cf59377;p=emacs.git Clean up code around 'ns-list-services' * 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. --- diff --git a/src/nsfns.m b/src/nsfns.m index a815ce656cb..00310c051ff 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -175,6 +175,7 @@ ns_directory_from_panel (NSSavePanel *panel) #endif } +#ifndef NS_IMPL_COCOA static Lisp_Object interpret_services_menu (NSMenu *menu, Lisp_Object prefix, Lisp_Object old) /* -------------------------------------------------------------------------- @@ -223,7 +224,7 @@ interpret_services_menu (NSMenu *menu, Lisp_Object prefix, Lisp_Object old) } return old; } - +#endif /* ========================================================================== @@ -2107,9 +2108,6 @@ DEFUN ("ns-list-services", Fns_list_services, Sns_list_services, 0, 0, 0, #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 @@ DEFUN ("ns-list-services", Fns_list_services, Sns_list_services, 0, 0, 0, [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