unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Alan Mackenzie <acm@muc.de>
Cc: "'bug-cc-mode@gnu.org'" <bug-cc-mode@gnu.org>,
	Chong Yidong <cyd@stupidchicken.com>,
	"Marshall,  Simon" <simon.marshall@misys.com>,
	"'emacs-devel@gnu.org'" <emacs-devel@gnu.org>
Subject: Re: Font-lock decides function call is function declaration in C+ +
Date: Sun, 11 Feb 2007 15:11:37 -0500	[thread overview]
Message-ID: <jwvlkj4qx9x.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20070211185523.GA7079@muc.de> (Alan Mackenzie's message of "11 Feb 2007 18\:40\:53 +0100\, Sun\, 11 Feb 2007 18\:55\:23 +0000")

> I think a solution might be to remove "foo" from c-found-types whenever
> text is inserted/deleted in the vicinity of "foo\n bar ();" which
> syntactically destroys its status as a type identifier.  I'll need to
> think a lot more about this.

I'd be interested to know what solution you end up using.  I've bumped into
a similar problem in sml-mode where I tried to look at the infix precedence
declarations in the file while font-locking to adjust the indentation
algorithm.

The best solution I found so far is to add a special text property covering
the "infix" declaration and whose value is the symbol whose precedence and
associativity is being set, and then in font-lock-unfontify-region I begin
by looking for this special property and removing the corresponding symbols
from the precedence table.  But this failed when the whole line was deleted
since the unfontify gets called after the text (and its text-property) is
removed (i.e. too late), so I ended up using before-change-functions
instead, which seemed too costly compared to the importance of the feature,
so it's still in the "experimental" state.

Maybe a better approach is to use overlays rather than text-properties, so
they don't completely disappear if the text is removed.


        Stefan

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


  reply	other threads:[~2007-02-11 20:11 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-05 16:46 Font-lock decides function call is function declaration in C+ + Marshall, Simon
2007-02-05 17:14 ` Chong Yidong
2007-02-07 20:45 ` Alan Mackenzie
2007-02-09 21:25   ` Chong Yidong
2007-02-11 17:40     ` Alan Mackenzie
2007-02-11 20:11       ` Stefan Monnier [this message]
2007-02-11 23:18       ` Chong Yidong
2007-02-12  2:45         ` Stefan Monnier
2007-02-12 17:59         ` Alan Mackenzie
2007-02-22 23:47 ` Font-lock decides function call is function declaration in C+ + - embryonic solution Alan Mackenzie
2007-03-01 17:19   ` Chong Yidong
2007-03-02  3:28     ` Richard Stallman
2007-03-03 10:18     ` Alan Mackenzie
2007-03-08 22:07     ` Font-lock decides function call is function declaration in C+ + - Patch Alan Mackenzie
2007-03-08 22:58       ` Chong Yidong
2007-03-09 21:25       ` Richard Stallman
2007-03-09 23:23         ` Alan Mackenzie
2007-03-11  4:24           ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2007-02-12 14:38 Font-lock decides function call is function declaration in C+ + Marshall, Simon
2007-02-12 15:53 ` Stuart D. Herring
2007-02-12 16:17   ` Stefan Monnier
2007-02-12 17:41   ` Alan Mackenzie
2007-02-12 18:06     ` Stuart D. Herring
2007-02-13 22:22       ` Alan Mackenzie
2007-02-09 10:32 Marshall, Simon
     [not found] <81CCA6588E60BB42BE68BD029ED48260105584F1@wimex2.wim.midas-kapiti.com>
2007-02-02  4:04 ` Chong Yidong
2007-01-26 21:18 Tetris trademark Chip Coldwell
2007-01-27  4:19 ` Richard Stallman
2007-01-27 13:03   ` Chris Moore
2007-01-27 13:39     ` Alfred M. Szmidt
2007-01-28 19:54       ` Chong Yidong
2007-01-28 20:23         ` Alfred M. Szmidt
2007-01-28 21:34           ` Chong Yidong
2007-01-28 22:41             ` Alfred M. Szmidt
2007-01-29  0:54               ` Chris Moore
2007-02-02 23:57                 ` Font-lock decides function call is function declaration in C+ + Chong Yidong

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=jwvlkj4qx9x.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=acm@muc.de \
    --cc=bug-cc-mode@gnu.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=simon.marshall@misys.com \
    /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).