unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gulshan Singh <gsingh2011@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Alan Mackenzie <acm@muc.de>, 21409@debbugs.gnu.org
Subject: bug#21409: 24.5; Wrong syntactic information for two line statement in an arglist
Date: Fri, 11 Mar 2022 17:52:38 -0800	[thread overview]
Message-ID: <CANEZYrf-W1Wei0PQrFb9BzXt9s7uQBzKNX1zXtOiKPDQuOL0OA@mail.gmail.com> (raw)
In-Reply-To: <87eek7taft.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

I know this is an old bug report, but I just realized it got a response,
and it seems like the behavior hasn't changed.

On Thu, Dec 3, 2020 at 3:07 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Gulshan Singh <gsingh2011@gmail.com> writes:
>
> > In c-mode (and all derivatives), the following code has the wrong
> > syntactic information (at least, in my opinion):
> >
> > foo(bar
> >     .baz()
> >     .qux());
> >
> > Putting point at `.baz()` and pressing C-c C-s shows it as an
> > `arglist-cont-nonempty`, when I'd expect it to be a
> > `statement-cont`. This causes the code to have the wrong indentation, as
> > above I would like to have the continued statements to be indented one
> > c-basic-offset, not aligned to the opening brace.
>
> (This bug report unfortunately got no response at the time.)
>
> I'm not sure how that should be indented, really -- the current
> indentation looks reasonable to me, I think?
>

It's definitely reasonable, but it's not what I'd prefer, which would be
this:

foo(bar
      .baz()
      .qux());

`.baz()` and `.qux()` are indented two spaces (my value for
`c-basic-offset`) from the start of `bar`, as opposed to aligned with
`bar`. This matches what happens if the call to `foo` isn't there:

bar
  .baz()
  .qux();

In any case, regardless of what indentation one would prefer for this case,
the issue remains that `c-show-syntactic-information` should be showing
`statement-cont` instead of `arglist-cont-nonempty` at `.baz()`.

[-- Attachment #2: Type: text/html, Size: 2000 bytes --]

  reply	other threads:[~2022-03-12  1:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04  5:50 bug#21409: 24.5; Wrong syntactic information for two line statement in an arglist Gulshan Singh
2020-12-03 11:07 ` Lars Ingebrigtsen
2022-03-12  1:52   ` Gulshan Singh [this message]
2022-03-12 11:32     ` Alan Mackenzie
     [not found]     ` <YiyE4jK9zIVMK/SX@ACM>
2022-03-13 13:43       ` Alan Mackenzie
2022-04-09 21:43         ` Gulshan Singh
2022-04-23 14:23           ` Alan Mackenzie
2022-04-23 20:10           ` 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=CANEZYrf-W1Wei0PQrFb9BzXt9s7uQBzKNX1zXtOiKPDQuOL0OA@mail.gmail.com \
    --to=gsingh2011@gmail.com \
    --cc=21409@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=larsi@gnus.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 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).