From: Jeff Norden <norden.jeff@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: Eli Zaretskii <eliz@gnu.org>, 64133@debbugs.gnu.org
Subject: bug#64133: CC Mode 5.35.2 (C/*l); incorrect indentation for an arrays of structs.
Date: Sun, 18 Jun 2023 11:10:46 -0500 [thread overview]
Message-ID: <CAPbFCnkgnf5LdSBpEbWyo-cGo2SOfnVhAwRjnpu3eWR0SVyr5g@mail.gmail.com> (raw)
In-Reply-To: <ZI8DFNzGLbRdoOgj@ACM>
On Sun, Jun 18, 2023 at 8:13 AM Alan Mackenzie wrote:
>...
> > > Thanks, I will let Alan chime in and decide whether this should be
> > > closed.
>
> I think, not yet.
>...
> I think I should be able to fix this in the next day or three.
Hi Alan
I don't know if this might help, but here is one more thing I found,
which I can't explain at all.
Tab is normally bound to c-indent-line-or-region. You can't directly
re-bind tab to c-indent-line. However, if you create an interactive
version with:
(defun cil() (interactive) (c-indent-line))
and bind it to tab, it has the exact same behavior. This eliminates
several levels of function calls between c-indent-line-or-region and
c-indent-line.
So, if you open the example with emacs -Q, define cil and bind it to
tab with "M-x local-set-key", you can "fix" the syntax by moving to
the beginning of the {3,4,5} line and pressing:
<tab><backspace><backspace><tab>
At this point "C-c C-s" shows brace-list syntax.
BUT, if you start again, and instead of defining "cil', just replace
each <tab> with "M-: (c-indent-line)<ret>", it does *not* change the
syntax that "C-c C-s" shows. For some reason that I don't understand,
it seems that the minibuffer read affects the behavior. To see this,
change the defun for "cil" by adding:
(read-from-minibuffer "press <ret>")
after (interactive). You now need to hit <ret> after each <tab>, but
I *cannot* get the syntax for the line to change with this function.
-Jeff
next prev parent reply other threads:[~2023-06-18 16:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-17 15:03 bug#64133: CC Mode 5.35.2 (C/*l); incorrect indentation for an arrays of structs Jeff Norden
2023-06-17 15:14 ` Eli Zaretskii
[not found] ` <CAPbFCnniiTyPQBmayZpRwS46--JW6ipmmLAzMterB5cK9NEXCA@mail.gmail.com>
2023-06-17 16:27 ` Eli Zaretskii
2023-06-17 17:36 ` Jeff Norden
2023-06-18 13:13 ` Alan Mackenzie
2023-06-18 16:10 ` Jeff Norden [this message]
2023-06-18 17:23 ` Jeff Norden
2023-06-19 11:46 ` Alan Mackenzie
2023-06-19 14:30 ` Jeff Norden
2023-06-21 10:39 ` Alan Mackenzie
2023-06-21 18:43 ` Jeff Norden
2023-06-27 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPbFCnkgnf5LdSBpEbWyo-cGo2SOfnVhAwRjnpu3eWR0SVyr5g@mail.gmail.com \
--to=norden.jeff@gmail.com \
--cc=64133@debbugs.gnu.org \
--cc=acm@muc.de \
--cc=eliz@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.