From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dino chiesa Newsgroups: gmane.emacs.devel Subject: RE: first-class support for csharp in cc-mode.el Date: Wed, 30 Dec 2009 08:29:14 -0800 Message-ID: References: <4B39DD6E.1070204@online.de>, , <20091230151945.GA8767@muc.de>, NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1262190596 5476 80.91.229.12 (30 Dec 2009 16:29:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Dec 2009 16:29:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 30 17:29:48 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NQ1Qi-0004Iv-7W for ged-emacs-devel@m.gmane.org; Wed, 30 Dec 2009 17:29:48 +0100 Original-Received: from localhost ([127.0.0.1]:47861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQ1Qi-0007LT-L9 for ged-emacs-devel@m.gmane.org; Wed, 30 Dec 2009 11:29:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NQ1QG-0007Bo-NT for emacs-devel@gnu.org; Wed, 30 Dec 2009 11:29:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NQ1QB-00079R-FQ for emacs-devel@gnu.org; Wed, 30 Dec 2009 11:29:19 -0500 Original-Received: from [199.232.76.173] (port=56351 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQ1QB-00079L-BR for emacs-devel@gnu.org; Wed, 30 Dec 2009 11:29:15 -0500 Original-Received: from col0-omc3-s1.col0.hotmail.com ([65.55.34.139]:59152) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NQ1QB-00059j-0G for emacs-devel@gnu.org; Wed, 30 Dec 2009 11:29:15 -0500 Original-Received: from COL124-W30 ([65.55.34.136]) by col0-omc3-s1.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 30 Dec 2009 08:29:14 -0800 X-Originating-IP: [96.236.193.50] Importance: Normal In-Reply-To: X-OriginalArrivalTime: 30 Dec 2009 16:29:14.0528 (UTC) FILETIME=[39A8BA00:01CA896D] X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:119054 Archived-At: Hi Alan=2C nice to meet you. Stefan=2C thanks for the input.=20 =20 acm@muc.de wrote: >> I don't have much experience with emacs-devel=2C but what would it take >> to get csharp to be supported as a first-class (built-in) language in >> cc-mode? > > The current policy is not to add any more languages to the core of CC > Mode=2C since it's hassle enough supporting the seven that are already > there. There are certainly lots of users of C=2C C++=2C Java=2C several u= sers > of Objective C and AWK=2C but I just don't know about Pike and IDL. The > problem is=2C when somebody implements support for a language directly in > CC Mode and they move on a few years later=2C support for that langauge > effectively vanishes. It was to fix this that Martin Stjernholm (my > predecessor) implemented the c-lang-const mechanism. > =20 Very clear. In that case I should be petitioning to get csharp-mode put int= o the emacs progmodes distrib separately=2C rather than petitioning to get = csharp-mode folded into cc-mode. > If the c-lang-const stuff is inadequate to support=2C say=2C C#=2C then I > would prefer to amend CC Mode so that C# can be supported. It looks > like the @"....." syntax will need such an amendment. This will > probably involve a large change=2C since the use of \ as an escape > character is firmly embedded in the very fabric of CC Mode. Is @ used > for anything else in C#? Is it forbidden to have whitespace between @ > and "? =20 Yes=2C according to the lang spec=2C the @ must immediately be followed by = a double-quote. The symbol is not used for anything else in the language. I= just looked and this is called a "verbatim string literal". http://www.go-mono.com/docs/index.aspx?link=3Decmaspec%3a9.4.4.5 > > In fact=2C I've just thought of a way of fixing this: in an after-change > function=2C splat the syntax (using syntax-table text-properties) of > anything within @"....". I think there's already a suitable hook in CC > Mode for this. > =20 Is this the approach used for handling of slashes within awk? (can be eithe= r a divide operator or a string delimiter). I tried wading through that cod= e but didn't yet figure it out. =20 In csharp=2C it is not only a trailing slash that is special - the verbatim= string also allows verbatim newlines in the string. This is legal: =20 var s =3D @"The quick brown fox jumps over the lazy dog"=3B =20 and results in a string with a \n between the 4th and 5th words. =20 I don't know how that might affect the final design of a solution=2C or if = it recommends or disrecommends Stefan's suggestion to worry only about the = final slash.=20 =20 =20 >> I have no idea if this is a friendly proposal or not=2C but it would >> make things nice for people who write C# and use emacs. > > Thanks for the proposal! Constructive suggestions are always welcome at > CC Mode. By the way=2C CC Mode has its own mailing list at > bug-cc-mode@gnu.org and is hosted on sourceforge for historical reasons. > =20 Ah=2C very good. Is bug-cc-mode intended to serve discussion related only t= o bugs or potential bugs=2C or is it also good for random discussion or que= stions from cc-derived modes? I mean=2C if I were to ask specifically about= the verbatim string literals=2C should I ask on emacs-devel or is it bette= r on bug-cc-mode ? >> There are still a few issues with that C# mode - lambdas have no >> special support=2C and the new dynamic keyword in .NET 4.0 isn't there >> (simple to add)=2C and there is the literal string thing I described in >> my other mail thread - but mostly it works well. Including this would >> provide a good baseline of support in emacs for C#. > > Those are all issues for C# Mode's maintainer. > =20 Right=2C those are issues for me (and friends) to own. I wasn't really aski= ng for *that*=2C although I may ask for specific advice on some of those in= the future=2C after I take a run at them=2C I hope you don't mind. My real goal regarding "first class support" is to make csharp-mode officia= l and standard=2C so that someone downloading emacs 24 or 23.x will just ge= t it. I had originally thought that meant major surgery on cc-mode=2C but y= ou're telling me it could be simpler than that. =20 monnier@iro.umontreal.ca wrote: > > So you're moving towards a CC-mode which is more like > a "generic" engine? That's good to hear. Do you intend to then move > support for AWK=2C IDL=2C Java=2C etc.. outside of the core CC-mode as we= ll? > I'll let Alan address that. =20 _________________________________________________________________ Hotmail: Powerful Free email with security by Microsoft. http://clk.atdmt.com/GBL/go/171222986/direct/01/=