From: Alan Mackenzie <acm@muc.de>
To: Daniel Colascione <dancol@dancol.org>
Cc: 34594@debbugs.gnu.org
Subject: bug#34594: cc-mode needs to support "final" in C++ classes
Date: Sat, 13 Apr 2019 13:36:45 +0000 [thread overview]
Message-ID: <20190413133645.GB13636@ACM> (raw)
In-Reply-To: <40982e49-bc1e-5164-bfc7-428860ce6391@dancol.org>
Hello, Daniel.
I've fixed this in master, pretty much as you suggested.
Feel free to try out the fix, and to tell me it isn't quite working.
;-)
--
Alan Mackenzie (Nuremberg, Germany).
On Fri, Apr 12, 2019 at 19:54:36 -0700, Daniel Colascione wrote:
> + Alan
> On 2/20/19 11:34 AM, Daniel Colascione wrote:
> >> Consider this:
> >>
> >> 1 struct QueryCache final : BasePyObject, SupportsGcClear,
> >> 2 HasDict, SupportsWeakRefs
> >>
> >> Without the "final", line 2 is classified as inher-cont. With the
> >> "final", it gets topmost-intro-cont and wrong indentation.
> >
> > Proposed fix:
> >
> > diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
> > index b4c12896f3..121888d825 100644
> > --- a/lisp/progmodes/cc-engine.el
> > +++ b/lisp/progmodes/cc-engine.el
> > @@ -12268,6 +12268,9 @@ c-guess-basic-syntax
> > (if (eq (char-after) ?<)
> > (zerop (c-forward-token-2 1 t indent-point))
> > t)
> > + (if (looking-at "final\\>[^_]")
> > + (c-forward-token-2 1 nil indent-point)
> > + t)
> > (eq (char-after) ?:))))
> > (goto-char placeholder)
> > (c-add-syntax 'inher-cont (c-point 'boi)))
> >
next prev parent reply other threads:[~2019-04-13 13:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-20 18:33 bug#34594: cc-mode needs to support "final" in C++ classes Daniel Colascione
2019-02-20 19:34 ` Daniel Colascione
2019-04-13 2:54 ` Daniel Colascione
2019-04-13 13:36 ` Alan Mackenzie [this message]
2019-04-13 13:57 ` Mauro Aranda
2019-04-13 19:43 ` Alan Mackenzie
2019-04-26 14:29 ` 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=20190413133645.GB13636@ACM \
--to=acm@muc.de \
--cc=34594@debbugs.gnu.org \
--cc=dancol@dancol.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).