From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!.POSTED!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.devel
Subject: [PATCH 11/13] Clean up code around 'ns-list-services'
Date: Sat, 20 May 2017 16:58:39 +0200
Message-ID: <20170520145841.94282-11-phst@google.com>
References: <20170520145841.94282-1-phst@google.com>
NNTP-Posting-Host: blaine.gmane.org
X-Trace: blaine.gmane.org 1495292888 11025 195.159.176.226 (20 May 2017 15:08:08 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 20 May 2017 15:08:08 +0000 (UTC)
Cc: Philipp Stephani
To: emacs-devel@gnu.org
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 20 17:08:04 2017
Return-path:
Envelope-to: ged-emacs-devel@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
by blaine.gmane.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1dC5zA-0002lQ-EZ
for ged-emacs-devel@m.gmane.org; Sat, 20 May 2017 17:08:04 +0200
Original-Received: from localhost ([::1]:34548 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1dC5zF-0005Pw-Vc
for ged-emacs-devel@m.gmane.org; Sat, 20 May 2017 11:08:10 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50017)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1dC5qm-0007ve-Jh
for emacs-devel@gnu.org; Sat, 20 May 2017 10:59:28 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1dC5ql-0003Ik-RA
for emacs-devel@gnu.org; Sat, 20 May 2017 10:59:24 -0400
Original-Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:34929)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
(Exim 4.71) (envelope-from )
id 1dC5ql-0003Ia-M5
for emacs-devel@gnu.org; Sat, 20 May 2017 10:59:23 -0400
Original-Received: by mail-wm0-x242.google.com with SMTP id g15so3663041wmc.2
for ; Sat, 20 May 2017 07:59:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=from:to:cc:subject:date:message-id:in-reply-to:references;
bh=zo9DT6hkVv0tm4zdFZhno+1Nag0zm3wUc3Np32vdtsc=;
b=bYoFi78KPlHePtIcVqWnVXXTn15/1/QCbaIJ6EUrjT9AEd1QcgRifuPz+BWqheHn2U
n2opJgVbXMhpKv8JYP0BdvjyA8aC2zTbuT9MvKGZlUKQZqYjRDkPLBormeULnCw5sPgi
GzdD3KOnQfsIXNAq7EsIGV8Bfz/+ako/Q08QbNzamCM5VbTAscpcgSCg0PQmN5UQaaR3
QUXW45g1aXnZpWAqDa1crJos1pwadnlfinkf9w0r2XULw+bLo7+hgCf5IDYVOy+42gwM
P2hl0JqfVZ5drEP+sRs4zgFO8SGOgBICVxceF1IXEvPogyw12qK4PKhL0FhnnpjgfToo
ApgQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
:references;
bh=zo9DT6hkVv0tm4zdFZhno+1Nag0zm3wUc3Np32vdtsc=;
b=oGGYo90fvCLA1D/xVtW4DHQVU/pvD+d02WId59NXc7lU3F+iVRgGNl0qzA27v+MOH0
FB6bxA4D6NKOUl7P1qDzQtbn/cOWyU39fik8gdPPBy4VuDeI9ynCyIGT5XQqsHxnSM9r
Dmbw6jfAIjQmIopRXgOjptHpc9TObd4Iea4S7eb5EgKQsQfUxrGk0nUtitncfwelM5N6
C0XePgF3Hb+g7lTx8ggQ+0mIotv05qmiCCkijJFu1mDK6VcSJLswl1hYhaBXjnz4ZvBE
xOvUxM5xf/iAqmzTc75QL65B1q7lz6UvgP64H0CkvQ9rzclLacQg9dKFtMwvZwyrHrMO
i63g==
X-Gm-Message-State: AODbwcDpPsm9cEFnq2Go6UzHc+iYuin24uYINw9zZ/Ug7B2GpsH1r7dN
93+qg7XHwOpSXw==
X-Received: by 10.28.145.194 with SMTP id t185mr8959351wmd.128.1495292362665;
Sat, 20 May 2017 07:59:22 -0700 (PDT)
Original-Received: from p.cm.cablesurf.de (46.128.198.151.dynamic.cablesurf.de.
[46.128.198.151])
by smtp.gmail.com with ESMTPSA id 4sm7795937wrv.33.2017.05.20.07.59.21
(version=TLS1 cipher=AES128-SHA bits=128/128);
Sat, 20 May 2017 07:59:22 -0700 (PDT)
X-Google-Original-From: Philipp Stephani
X-Mailer: git-send-email 2.13.0
In-Reply-To: <20170520145841.94282-1-phst@google.com>
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 2a00:1450:400c:c09::242
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "Emacs development discussions."
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Original-Sender: "Emacs-devel"
Xref: news.gmane.org gmane.emacs.devel:215027
Archived-At:
* 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