all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Theodor Thornhill <theo@thornhill.no>
To: emacs-devel@gnu.org
Subject: CC Mode lambda function help
Date: Fri, 25 Sep 2020 23:05:42 +0200	[thread overview]
Message-ID: <87h7rlr2hl.fsf@thornhill.no> (raw)


Hello!

I am reworking the csharp mode found at
https://github.com/josteink/csharp-mode, and I have some problems I am
really struggling to fix, or find information about in the manual (if
it is there):

1. Lambda functions

Consider this code:

```
AsyncTest.Run(async () =>
{
    Something xyz =
        new SomethingMore();
});
```

Right now this indents as:
```
AsyncTest.Run(async () =>
              {
                  Something xyz =
                  new SomethingMore();
              });
```
I cannot find what c-lang-defconst to configure, or what c-style-alist
combination to pick to get this.  Any pointer to what is wrong would be
super helpful.

2. Attributes

Consider this code:

```
[DllImport("something.dll")]
public extern int GetSomething();

```

Gets indented as:
```
[DllImport("something.dll")]
    public extern int GetSomething();
```

This I attribute (pun intended) to vsemi, since when one is added:
```
[DllImport("something.dll")];  // <-- notice this
public extern int GetSomething();
```

It behaves correctly. In addition, that semi fixes fontification for the
method name. I would like not to use the 'statement-cont', since that
only looks like a symptom, rather than a fix.

I'd love some pointers to how I would best handle this. 

To reproduce this, you have to (unfortunately...) clone the
abovementioned repo, checkout the 'rework' branch, then byte compile
that file.  I am sorry there is no quicker way to get to that code.

These snippets should be enough to illustrate my issues.

Have a lovely day,
Theodor Thornhill




             reply	other threads:[~2020-09-25 21:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 21:05 Theodor Thornhill [this message]
2020-10-09 10:57 ` CC Mode lambda function help Alan Mackenzie
2020-10-09 12:43   ` Theodor Thornhill

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7rlr2hl.fsf@thornhill.no \
    --to=theo@thornhill.no \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.