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: cc-mode: Make all parameters introduced in Emacs 26 optional Date: Mon, 22 Jan 2018 09:09:21 +0100 Message-ID: <1516608561.1943450.1243462056.1A47A60F@webmail.messagingengine.com> Reply-To: jostein@kjonigsen.net NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_----------=_151660856119434501" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1516608479 10707 195.159.176.226 (22 Jan 2018 08:07:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 22 Jan 2018 08:07:59 +0000 (UTC) Cc: Alan Mackenzie To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 22 09:07:55 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 1edX8g-0001KM-2k for ged-emacs-devel@m.gmane.org; Mon, 22 Jan 2018 09:07:34 +0100 Original-Received: from localhost ([::1]:54615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edXAg-00023j-EW for ged-emacs-devel@m.gmane.org; Mon, 22 Jan 2018 03:09:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edXAW-00023A-Ke for emacs-devel@gnu.org; Mon, 22 Jan 2018 03:09:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edXAT-0005dz-Dy for emacs-devel@gnu.org; Mon, 22 Jan 2018 03:09:28 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:56725) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edXAT-0005co-7O for emacs-devel@gnu.org; Mon, 22 Jan 2018 03:09:25 -0500 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7477F20D33; Mon, 22 Jan 2018 03:09:21 -0500 (EST) Original-Received: from web5 ([10.202.2.215]) by compute6.internal (MEProxy); Mon, 22 Jan 2018 03:09:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:content-transfer-encoding :content-type:date:from:message-id:mime-version:reply-to:subject :to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=rJDvuB/X/ICuSu Ki0bJkrQPnaS/Hx+LgTZ3gPo9+L5s=; b=cFNd5v2jn5tIpRIQP5BWSuY8NtZpsC TMEOSKf9W9C8dRGN5IhwH3dw/PCnl9PEDWfGFBwcMrgyIVEaoE3f/kEQCOO5K29O xh955XK7vk7qalObIVmy1SfeOfhtYd9T3JnBZN7cdCC0aKult6+c0l760b1VLgGf C2ipgLExwOp9wjJgUYjQ68WzjxKQ/KPb2PORmh9YuoZtoUk9ouwDLASXI3xKzAmq DNtL7CsnRXsA1vM3Aae3lqNNhV0quf6wSWSQoDDVxSd/VmfgQaFpmQyfJ+OEBzxk 6pm8DhqT3+VtZ/N1h7oejxfNDb7Pm8om2SrqZFVPQotv5Ww0MfjCBHPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:reply-to:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=rJDvuB/X/ICuSuKi0 bJkrQPnaS/Hx+LgTZ3gPo9+L5s=; b=OJv6aEQ2Z4su1tso+FOcG2IomxeXnX7aa 4nsINIPtCJmZ1Ef45RN5FPCfq+ZXNri5L+QwbAPzsodCRvMzNLUmFIpVstH+YjP7 ckZTeLyN+UaR/7cXLZVX0kGcxGjRiveHOCRps0hZ+ECaCb/nGcPCq23PPmmWDGeb bu0KiPqYv0EfVv1pZOmFzSxltFoN+FIrbTXvEhYsbtXKCqX9pCkivkxI3ipVPXZL dH2R68uso77Y4Md89sybLiZuSr7vq4N53qHDD4AlQSLAUA0eJE0202EBrOEcyCij EZwqZsfZb6mq9iTKzQ9ZycWP1f8pfKpoalXlxbdKc9hu9EworNrmw== X-ME-Sender: Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id 4F1389E11B; Mon, 22 Jan 2018 03:09:21 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface - ajax-75de3051 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.26 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:222133 Archived-At: This is a multi-part message in MIME format. --_----------=_151660856119434501 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hey everyone. While cc-mode seems to be a foundation for lots of the major-modes shipped with Emacs, it's also used by third-party packages. For major-modes shipped with Emacs, changes to the core cc-mode functions is not that big of a problem, since they can be changed in tandem with the changes to cc-mode itself. For third party modules (like csharp-mode, which I maintain), changes to cc-mode core-functions are more problematic due to Emacs lacking reliable introspection capabilities. As an example in the Emacs 26 branch c-font-lock-declarators is now declared like this: (defun c-font-lock-declarators (limit list types not-top &optional template- class) ...) While in Emacs 25.3 and earlier it's declared like this: (defun c-font-lock-declarators (limit list types) ...) Basically the number of mandatory parameters has been bumped from 3 to 4, with another optional parameter added. These kinds of changes makes it harder for third party modules to maintain compatibility across Emacs-versions. Wouldn't it be better to make *all *the new parameters optional and thus maintain compatibility? Are there any good reasons not to do so? -- Regards Jostein Kj=C3=B8nigsen jostein@kjonigsen.net =F0=9F=8D=B5 jostein@gmail.com https://jostein.kjonigsen.net --_----------=_151660856119434501 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"
Hey everyone.

While cc-mode seems to be a foundation for lots of the major-modes shi= pped with Emacs, it's also used by third-party packages.

For major-modes shipped with Emacs, changes to the core cc-mode functi= ons is not that big of a problem, since they can be changed in tandem with = the changes to cc-mode itself.

For third party modules (like csharp-mode, which I maintain), changes = to cc-mode core-functions are more problematic due to Emacs lacking reliabl= e introspection capabilities.

As an example in the Emacs 26 branch c-font-lock-declarators is now de= clared like this:

(defun c-font-lock-declarators (limit list types not-top &op=
tional template-class)
  ...)

While in Emacs 25.3 and earlier it's declared like this:

(defun c-font-lock-declarators (limit list types)
  ...)

Basically the number of mandatory parameters has been bumped from 3 to= 4, with another optional parameter added.

These kinds of changes makes it harder for third party modules to main= tain compatibility across Emacs-versions.

Wouldn't it be better to make all the new parameters optional a= nd thus maintain compatibility? Are there any good reasons not to do so?

--
Regard= s
Jostein Kj=C3=B8nigsen


--_----------=_151660856119434501--