Article View: gnu.emacs.bug
Article #87312cplus-md.el
From: Jonathan Polito - ATT ASCC
Date: Fri, 30 Sep 1994 20:23
Date: Fri, 30 Sep 1994 20:23
28 lines
2007 bytes
2007 bytes
In GNU Emacs 19.25.5 of Thu Sep 8 1994 on speed (sparc-sun-sunos)
There is a bug in indent-c++-exp at the point where the line
indentation is adjusted for its conents. Namely it begins:
(if (looking-at "\\(public\\|private\\|protected\\):")
(setq this-indent (- this-indent c-indent-level)))
(if (or (looking-at "case[ \t]")
(and (looking-at "[A-Za-z]")
(save-excursion
(forward-sexp 1)
(looking-at ":[^:]"))))
(setq this-indent (max 1 (+ this-indent c-label-offset))))
The problem with this is that the first looking at (public:, private:,
protected:) will match the looking at case label part ([A-Za-z]<sexp>:)
Consequently, public:, private:, protected: will be indented
incorrectly. It seems a simple fix is to do something like:
(if (or (looking-at "case[ \t][A-Za-z].*:[^:]")
(looking-at "default:"))
(setq this-indent (max 1 (+ this-indent c-label-offset))))
Jon.
----------------------------------------------------------------------------
Jonathan Polito (919)380-4585 voice AT&T - ASCC
ASOS - OAM (919)380-4518 fax 2000 Regency Pky, Ste. 500
Jon.Polito@att.com Cary, NC 27511
Technical Details
Message-ID:
<9409302021.AA28344@ascc01.ascc.att.com>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!ascc01.ascc.ATt.COM!jepShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,4920f1baa59a4544,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-10-01 00:28:24 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!ascc01.ascc.ATt.COM!jep From: jep@ascc01.ascc.ATt.COM (Jonathan Polito - ATT ASCC) Newsgroups: gnu.emacs.bug Subject: cplus-md.el Date: 30 Sep 1994 16:23:28 -0400 Organization: GNUs Not Usenet Lines: 28 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <9409302021.AA28344@ascc01.ascc.att.com>