From: dino chiesa <dpchiesa@hotmail.com>
To: <monnier@iro.umontreal.ca>, <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: RE: first-class support for csharp in cc-mode.el
Date: Wed, 30 Dec 2009 08:29:14 -0800 [thread overview]
Message-ID: <COL124-W302685C097D1C55BD1B015CE790@phx.gbl> (raw)
In-Reply-To: <m2pr5w5vbq.fsf-monnier+emacs@gnu.org>
Hi Alan, nice to meet you.
Stefan, thanks for the input.
acm@muc.de wrote:
>> I don't have much experience with emacs-devel, 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, since it's hassle enough supporting the seven that are already
> there. There are certainly lots of users of C, C++, Java, several users
> of Objective C and AWK, but I just don't know about Pike and IDL. The
> problem is, when somebody implements support for a language directly in
> CC Mode and they move on a few years later, support for that langauge
> effectively vanishes. It was to fix this that Martin Stjernholm (my
> predecessor) implemented the c-lang-const mechanism.
>
Very clear. In that case I should be petitioning to get csharp-mode put into the emacs progmodes distrib separately, rather than petitioning to get csharp-mode folded into cc-mode.
> If the c-lang-const stuff is inadequate to support, say, C#, 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, 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 "?
Yes, according to the lang spec, 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=ecmaspec%3a9.4.4.5
>
> In fact, I've just thought of a way of fixing this: in an after-change
> function, splat the syntax (using syntax-table text-properties) of
> anything within @"....". I think there's already a suitable hook in CC
> Mode for this.
>
Is this the approach used for handling of slashes within awk? (can be either a divide operator or a string delimiter). I tried wading through that code but didn't yet figure it out.
In csharp, it is not only a trailing slash that is special - the verbatim string also allows verbatim newlines in the string. This is legal:
var s = @"The quick brown fox
jumps over the lazy dog";
and results in a string with a \n between the 4th and 5th words.
I don't know how that might affect the final design of a solution, or if it recommends or disrecommends Stefan's suggestion to worry only about the final slash.
>> I have no idea if this is a friendly proposal or not, 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, CC Mode has its own mailing list at
> bug-cc-mode@gnu.org and is hosted on sourceforge for historical reasons.
>
Ah, very good. Is bug-cc-mode intended to serve discussion related only to bugs or potential bugs, or is it also good for random discussion or questions from cc-derived modes? I mean, if I were to ask specifically about the verbatim string literals, should I ask on emacs-devel or is it better on bug-cc-mode ?
>> There are still a few issues with that C# mode - lambdas have no
>> special support, and the new dynamic keyword in .NET 4.0 isn't there
>> (simple to add), 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.
>
Right, those are issues for me (and friends) to own. I wasn't really asking for *that*, although I may ask for specific advice on some of those in the future, after I take a run at them, I hope you don't mind.
My real goal regarding "first class support" is to make csharp-mode official and standard, so that someone downloading emacs 24 or 23.x will just get it. I had originally thought that meant major surgery on cc-mode, but you're telling me it could be simpler than that.
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, IDL, Java, etc.. outside of the core CC-mode as well?
>
I'll let Alan address that.
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/171222986/direct/01/
next prev parent reply other threads:[~2009-12-30 16:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-29 1:51 cc-mode help - how to support literal strings in C# syntax? dino chiesa
2009-12-29 10:43 ` Andreas Roehler
2009-12-30 4:40 ` dino chiesa
2010-01-01 11:43 ` Andreas Roehler
2010-01-01 16:04 ` Andreas Roehler
2009-12-30 5:01 ` first-class support for csharp in cc-mode.el dino chiesa
2009-12-30 6:17 ` Miles Bader
2009-12-30 7:18 ` dino chiesa
2009-12-30 11:09 ` Miles Bader
2009-12-30 15:00 ` dino chiesa
2009-12-30 15:19 ` Alan Mackenzie
2009-12-30 15:39 ` Stefan Monnier
2009-12-30 16:29 ` dino chiesa [this message]
2009-12-30 16:57 ` Stefan Monnier
2009-12-30 21:01 ` Alan Mackenzie
2009-12-30 21:03 ` dino chiesa
2009-12-31 2:44 ` Miles Bader
2009-12-31 2:58 ` Jason Rumney
2009-12-31 3:08 ` Deniz Dogan
2009-12-31 3:18 ` dino chiesa
2009-12-31 3:13 ` dino chiesa
2009-12-31 11:43 ` Vagn Johansen
2009-12-30 20:19 ` Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=COL124-W302685C097D1C55BD1B015CE790@phx.gbl \
--to=dpchiesa@hotmail.com \
--cc=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).