From: Alan Mackenzie <acm@muc.de>
To: "Eric M. Ludlam" <eric@siege-engine.com>
Cc: Chong Yidong <cyd@stupidchicken.com>,
"Eric M. Ludlam" <zappo@gnu.org>,
emacs-devel@gnu.org
Subject: Re: Semantic parser uses c-forward-conditional
Date: Tue, 22 Sep 2009 22:08:52 +0000 [thread overview]
Message-ID: <20090922220852.GB3722@muc.de> (raw)
In-Reply-To: <1253619827.10118.38.camel@projectile.siege-engine.com>
Hi, Eric,
On Tue, Sep 22, 2009 at 07:43:47AM -0400, Eric M. Ludlam wrote:
> On Tue, 2009-09-22 at 10:57 +0000, Alan Mackenzie wrote:
> > I'm not very keen on that, but how about this instead: a new defun
> > c-forward-conditional-1 which does the same, except it doesn't push a
> > mark, doesn't throw errors like "No following conditional at this
> > level", and returns the final point, or nil?
> > Then all occurances inside CEDET can be changed to
> > (cedet-forward-c-conditional), where the following macro goes into
> > CEDET:
> > (require 'cc-cmds)
> > (defmacro forward-cedet-c-conditional (count &optional target-depth with-else)
> > ....
> > (if (fboundp 'c-forward-conditional-1) ...)
> > ....
> > )
> > This will avoid complexifying cc-cmds.el, whilst still allowing CEDET
> > and friends to work with older CC MODE versions. It would also be good
> > for CC MODE to separate out the "engine" part of the command from the
> > "wrapper".
> The above seems like a fine solution to me.
I've had a closer look at it, and it seems it would be better to let
c-forward-conditional just signal errors (which it does when there aren't
enough conditional to go over/out of/into). c-f-c (which is patterned on
scan-lists) also does all the work for c-backward-conditional etc., so
returning some sort of error status would mean having to throw
identically in the other five defuns. Callers can catch the error if
they need to, just as they do at the moment.
I'll just take out the setting of the mark.
> > As a matter of interest, have you grepped CEDET to find other similar
> > problems?
> All the C support for the parser is in one. It also uses c-end-of-macro
> which stands out for me.
Thanks! c-end-of-macro isn't a problem, it just goes forward past
escaped EOLs.
> Eric
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2009-09-22 22:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-21 19:19 Semantic parser uses c-forward-conditional Chong Yidong
2009-09-21 19:21 ` Chong Yidong
2009-09-22 10:57 ` Alan Mackenzie
2009-09-22 11:43 ` Eric M. Ludlam
2009-09-22 22:08 ` Alan Mackenzie [this message]
2009-09-23 6:30 ` Richard Stallman
2009-09-23 9:24 ` Alan Mackenzie
2009-09-23 11:22 ` Eric M. Ludlam
2009-09-24 20:44 ` Alan Mackenzie
2009-09-22 16:24 ` Richard Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090922220852.GB3722@muc.de \
--to=acm@muc.de \
--cc=cyd@stupidchicken.com \
--cc=emacs-devel@gnu.org \
--cc=eric@siege-engine.com \
--cc=zappo@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.