From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?Q?Jostein=20Kj=C3=B8nigsen?= Newsgroups: gmane.emacs.devel Subject: Re: cc-mode: Make all parameters introduced in Emacs 26 optional Date: Tue, 13 Mar 2018 21:08:04 +0100 Message-ID: <1520971684.2873032.1301975008.24C87686@webmail.messagingengine.com> References: <1516608561.1943450.1243462056.1A47A60F@webmail.messagingengine.com> <20180122203254.GA4888@ACM> <1520885798.1440538.1300560400.68951242@webmail.messagingengine.com> Reply-To: jostein@kjonigsen.net NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_----------=_152097168428730320" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1520971604 8476 195.159.176.226 (13 Mar 2018 20:06:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Mar 2018 20:06:44 +0000 (UTC) To: emacs-devel@gnu.org, Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 13 21:06:39 2018 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 1evqBy-00026Q-T7 for ged-emacs-devel@m.gmane.org; Tue, 13 Mar 2018 21:06:39 +0100 Original-Received: from localhost ([::1]:42543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evqE2-0000j6-08 for ged-emacs-devel@m.gmane.org; Tue, 13 Mar 2018 16:08:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evqDR-0000ig-B4 for emacs-devel@gnu.org; Tue, 13 Mar 2018 16:08:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evqDO-00061I-1P for emacs-devel@gnu.org; Tue, 13 Mar 2018 16:08:09 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:49181) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1evqDN-00060p-OA for emacs-devel@gnu.org; Tue, 13 Mar 2018 16:08:05 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EDEAF212DE; Tue, 13 Mar 2018 16:08:04 -0400 (EDT) Original-Received: from web1 ([10.202.2.211]) by compute6.internal (MEProxy); Tue, 13 Mar 2018 16:08:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :reply-to:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=dL5mLM+FdRB9SRLsRm/ZLAlWbayFBnw3alqAtihv4cM=; b=HYFP1xFxm7tY yKt+zCPc4gxfAZUAZU+GI6+1XYUFU/PoGo60DquCLE38P/ffAzhrmKLV7BiaKRvZ scbmUA9fWh8rvjAWC+T5bDqYIK3btOh4jmlglEYTy4QLmhkoGjgps3NqJQlT0Aup njAdELrATa2KynySpEtapHdgkw4OsuaMj60jGrNWpNysNqfIQ48HePGnDeMXTKCl 31BGJ+YTh5H1Ovxr+3EHE/fQf2VEv+g3uvZlO9TY2BRDr5K+GC5tVTD3tfwOSIs8 SAkGoVyjMDncg8wYrZa46LqxR99Vcbe8UaxIeQcQ4jeUQvBCPqqxa5E1HcJMH+rK q27GCEN/jA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :reply-to:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=dL5mLM+FdRB9SRLsRm/ZLAlWbayFBnw3alqAtihv4cM=; b=NCA3xV1s7HH8 G5XZYr85CoORkYAR0QCmTqZMQ0jXlpmFUnP2vsvSm/W8RhsfKnzjPn73jjq6YRVx bz/Vl52MsKVWoYZxA6EjmAnqxaSspihve8N1mBrcFTeiqUDBfdGT1MMaH0yhbDxC WE8Y0mtcr+4pnNs0/+GpUT6SYN13uASqggbOfOTQrSfVcU841Ed8AJ2xw0SorMzQ 9GrizTwLooEgQheHu0ygvqTZlBGjQJkizTwybyCtrIKj+TxE4VH++3Y+8a6Es5cZ KovvjwT/uBd4xwKuIdsoegZMIXz3gKo/wSazpBh5BNt02hrwu0cU6IyAAhk4+8Dm Gw+fn8vkPg== X-ME-Sender: Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id CD5E294098; Tue, 13 Mar 2018 16:08:04 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface - ajax-54087d22 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 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:223705 Archived-At: This is a multi-part message in MIME format. --_----------=_152097168428730320 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Thanks Stefan.=20 That's great help and for now will allow me to provide working C# support to Emacs 26 users, while I work out what to do with our troublesome usage of internal cc-mode functions. I really appreciate it. I picked up this project as a community service when editing C# stopped working sometime in Emacs 24, and it would be pretty daft to simply give up on it now. :) -- Regards Jostein Kj=C3=B8nigsen On Mon, Mar 12, 2018, at 11:40 PM, Stefan Monnier wrote: >> Is there any way for package to know how many mandatory arguments a >> function has, to be able to branch out for compatibility reasons? >=20 > The way I recommend is: >=20 > (condition-case nil > (call1 ...) > (wrong-number-of-arguments > (call2 ...))) >=20 >=20 > -- Stefan >=20 >=20 --_----------=_152097168428730320 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"
Thanks Stefan.

That's great help and for now will allow me to provide working C# supp= ort to Emacs 26 users, while I work out what to do with our troublesome usa= ge of internal cc-mode functions. I really appreciate it.

I picked up this project as a community service when editing C# stoppe= d working sometime in Emacs 24, and it would be pretty daft to simply give = up on it now. :)

--
Regard= s
Jostein Kj=C3=B8nigsen


On Mon, Mar 12, 2018, at 11:40 PM, Stefan Monnier wrote:
Is there any way for package to = know how many mandatory arguments a
function has, to be able to branch out for compatibility reasons?
<= /div>

The way I recommend is:

    (condition-case nil
        (call1 ...)
      (wrong-number-of-arguments
      (call2 ...)))


-- Stefan



--_----------=_152097168428730320--