From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gulshan Singh Newsgroups: gmane.emacs.bugs Subject: bug#21409: 24.5; Wrong syntactic information for two line statement in an arglist Date: Fri, 11 Mar 2022 17:52:38 -0800 Message-ID: References: <87eek7taft.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005c5caa05d9fbb446" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34538"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Mackenzie , 21409@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 12 02:53:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSqwQ-0008lS-73 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Mar 2022 02:53:10 +0100 Original-Received: from localhost ([::1]:60700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSqwO-0004Wl-QE for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Mar 2022 20:53:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSqwI-0004Wb-CW for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2022 20:53:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSqwH-0001qu-V7; Fri, 11 Mar 2022 20:53:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nSqwH-0004K8-T2; Fri, 11 Mar 2022 20:53:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gulshan Singh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 12 Mar 2022 01:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21409 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 21409-submit@debbugs.gnu.org id=B21409.164704997716610 (code B ref 21409); Sat, 12 Mar 2022 01:53:01 +0000 Original-Received: (at 21409) by debbugs.gnu.org; 12 Mar 2022 01:52:57 +0000 Original-Received: from localhost ([127.0.0.1]:38866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSqwC-0004Jp-Kp for submit@debbugs.gnu.org; Fri, 11 Mar 2022 20:52:56 -0500 Original-Received: from mail-ed1-f51.google.com ([209.85.208.51]:37858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSqwB-0004Jb-Hk for 21409@debbugs.gnu.org; Fri, 11 Mar 2022 20:52:55 -0500 Original-Received: by mail-ed1-f51.google.com with SMTP id b15so8852893edn.4 for <21409@debbugs.gnu.org>; Fri, 11 Mar 2022 17:52:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hY1wifJu16KYzvdbC3yQTXSH6kLFj0qauVvxVesZlXQ=; b=XuzWBynbzHpBY56Brl9/myOD/Z0jY0+UiP3rmrihCZ69z/8me7Tl7ODCh4PQgUD+Ax FbiRoeK6Q4JulW0Oes1N0MRIT+ax0HYQhUifmewJAfmaYCh19J9WpbDDPeNegwV9RCJx LZm5oWjQHcaV/Cv93t26An/K74qydXp5JWxV695qJYI7P4rbDsMLwGaRoYnJcrcc0GlN 9pRhSmRQAWm22pJRQ8CusqXngyJKMHXvUTBJk+NkQA0InNYxUCm1RXIat6yV6ntRlfbZ sExBEyGamOA+dKGp3yqop9jT7iqLCb0w9OVyCW4EHU/uu/uqls3ZfUy1XZs6yU5xww92 oHeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hY1wifJu16KYzvdbC3yQTXSH6kLFj0qauVvxVesZlXQ=; b=YK6rB4v7460lCYmAVFFvgxcn47wvwvi9NvQfW1Er5tCJOoisQQNn+lZWGCfav52zFw JWRx8abpKdKr1Kgt9kSNDxQUg09eG2bgcl/6sJEQSB19ZlsZh09U2rOhiFgrcabs0YAc hrfmWTVkwK046+rU8AxkO9H9CiG4WUcbV5p1UWuh/4A2LUvjsZE56zkO4jdzhPm6SK+x HBfja6vAbqFxtUnKxV+4TAnjKUd5RzWDo1JV3HvNFUh8wkjqPibgOdL3R1cDu+13vRXn SjC32L43/xkTahGqS0oHyt+Fu8ZVEvrt9jgOGLbDSDAneJs8DC8PcliHzgBOeFmRqhGN VPCA== X-Gm-Message-State: AOAM531P1y240v/XJ2XGeCoCguFUL3MhV1Kx04DRI0Cvqy+C4lsLyj+U NtQpwi5ADPHyrOkDnjFP3k4fqxj50VwumbpCoLs= X-Google-Smtp-Source: ABdhPJzRZHQat6+acxeDTMryZg50L8fvxzlFhT1Jcc2+dmrcpuRvbMFX4gW3hUnBxiAVmPTk+wUznT0zJhVVndLGf4g= X-Received: by 2002:a05:6402:3489:b0:416:9121:6936 with SMTP id v9-20020a056402348900b0041691216936mr11503923edc.249.1647049969512; Fri, 11 Mar 2022 17:52:49 -0800 (PST) In-Reply-To: <87eek7taft.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228241 Archived-At: --0000000000005c5caa05d9fbb446 Content-Type: text/plain; charset="UTF-8" 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 wrote: > Gulshan Singh 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()`. --0000000000005c5caa05d9fbb446 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I know this is an old bug report, but I j= ust realized it got a response, and it seems like the behavior hasn't c= hanged.

On Thu, Dec 3, 2020 at 3:07 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
Gulshan= Singh <gsingh= 2011@gmail.com> writes:

> In c-mode (and all derivatives), the following code has the wrong
> syntactic information (at least, in my opinion):
>
> foo(bar
>=C2=A0 =C2=A0 =C2=A0.baz()
>=C2=A0 =C2=A0 =C2=A0.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
=C2=A0 =C2=A0 =C2=A0 .baz()
=C2= =A0 =C2=A0 =C2=A0 .qux());

`.baz()` and=C2=A0`.qux()` are indented t= wo spaces (my value for `c-basic-offset`) from the start of `bar`, as oppos= ed to aligned with `bar`. This matches what happens if the call to `foo` is= n't there:

bar
=C2=A0 .baz()
=C2=A0 .qux();

In any = case, regardless of what indentation one would prefer for this case, the is= sue remains that `c-show-syntactic-information` should be showing `statemen= t-cont` instead of `arglist-cont-nonempty` at `.baz()`.
--0000000000005c5caa05d9fbb446--