unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleh Krehel <oleh@oremacs.com>
To: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: Re: CC-mode highlight change between 24.5 and 25
Date: Mon, 05 Sep 2016 11:27:40 +0200	[thread overview]
Message-ID: <87d1kid7cj.fsf@oremacs.com> (raw)
In-Reply-To: <20160904153800.GB3554@acm.fritz.box> (Alan Mackenzie's message of "Sun, 4 Sep 2016 15:38:00 +0000")

Hi Alan,

Alan Mackenzie <acm@muc.de> writes:

> OK.  Here's a first approximation to a solution, which I would be
> grateful if you could try out on real code.  Please let me know how well
> it works, and if it introduces any nasty looking bugs.
>
> What I've done is to count nesting depth of braces inside a class or
> namespace, etc.  When that depth is 1, we're at the top level, and
> anything looking like a function is fontified as one.  When the depth is
> more than 1, we're not at top level, and anything looking like a
> function is fontified as a uniform initialisation.
>
> The following patch should apply OK to the savannah master branch:

Thanks for the patch. I'm testing it now. It works fine with the example
that I initally gave. However, this one does not work:

    template <class T> void barf (T t, const char *file_name) {
      std::ofstream fout (file_name);
      fout << t;
      fout.close ();
    }

Here, "template <class T>" is what confuses the font-lock. In C++, these
angle braces can be nested to an arbitrary depth.

Oleh



  reply	other threads:[~2016-09-05  9:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 11:58 CC-mode highlight change between 24.5 and 25 Oleh Krehel
2016-09-02 13:27 ` Alan Mackenzie
2016-09-02 14:10   ` Yuri Khan
2016-09-02 14:40     ` Alan Mackenzie
2016-09-02 17:39       ` Davis Herring
2016-09-02 17:48         ` Eli Zaretskii
2016-09-04 22:29         ` Alan Mackenzie
2016-09-02 14:18   ` Oleh Krehel
2016-09-02 14:31     ` Alan Mackenzie
2016-09-02 17:21       ` Davis Herring
2016-09-04 15:38     ` Alan Mackenzie
2016-09-05  9:27       ` Oleh Krehel [this message]
2016-09-05 15:20         ` Alan Mackenzie
2016-09-06 13:37           ` Oleh Krehel
2016-09-06 17:02             ` Alan Mackenzie
2016-09-07 14:10               ` Alan Mackenzie
2016-09-09 10:01                 ` Oleh Krehel
2016-09-11 21:22                   ` 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=87d1kid7cj.fsf@oremacs.com \
    --to=oleh@oremacs.com \
    --cc=acm@muc.de \
    --cc=emacs-devel@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 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).