🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #791

c-mode indentation doesn't do `do ... while' right.

#791
From: Roland McGrath
Date: Mon, 12 Oct 1992 09:28
19 lines
785 bytes
Put the following text in a buffer in c-mode, and do C-M-q.

{
  if (cond)
    do
      stmt;
    while (cond);
}

It becomes:

{
  if (cond)
    do
      stmt;
  while (cond);
}

It wins if you put curly braces around the do...while statement.
Technical Details
Message-ID: <9210121728.AA19112@geech.gnu.ai.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!wupost!spool.mu.edu!umn.edu!paperboy.micro.umn.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!gnu.ai.mit.edu!roland

Show Full Headers
Complete Article Headers
Newsgroups: gnu.emacs.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!wupost!spool.mu.edu!umn.edu!paperboy.micro.umn.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!gnu.ai.mit.edu!roland
From: roland@gnu.ai.mit.edu (Roland McGrath)
Subject: c-mode indentation doesn't do `do ... while' right.
Message-ID: <9210121728.AA19112@geech.gnu.ai.mit.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 12 Oct 1992 09:28:45 GMT
Approved: bug-gnu-emacs@prep.ai.mit.edu
Lines: 22