emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Semantic parser uses c-forward-conditional


From: Alan Mackenzie
Subject: Re: Semantic parser uses c-forward-conditional
Date: Thu, 24 Sep 2009 20:44:59 +0000
User-agent: Mutt/1.5.9i

Hi, Eric!

On Wed, Sep 23, 2009 at 07:22:56AM -0400, Eric M. Ludlam wrote:
> On Wed, 2009-09-23 at 09:24 +0000, Alan Mackenzie wrote:
> > Hi, Richard and Eric!

> > How about `c-scan-conditionals', since the function does the same as
> > scan-lists, more or less?  Actually, more, since it moves point to the
> > end position, unlike scan-lists.  Maybe the new c-scan-conditionals
> > shouldn't move point?

> > Eric, what do you think?


> For your reference, here is the file in which I use
> c-forward-conditional, and any other c specific functions:

> http://cedet.cvs.sourceforge.net/viewvc/*checkout*/cedet/cedet/semantic/bovine/semantic-c.el

Thanks, I had a look at that.

> It would not greatly affect my code if some new function moved the
> point, or just returned where the end is.

OK.  I just committed a change to .../lisp/progmodes/cc-cmds.el with the
new function c-scan-conditionals which doesn't set the mark, and doesn't
move point, instead returning the final position, much like scan-lists.

> In semantic-c-skip-conditional-section it is trying to do more than
> just skip a conditional.  It is trying to skip only parts of a
> conditional, and allow other parts to be analyzed regularly.  (ie -
> execute the effects of the preprocessor.)  The c-forward-conditional
> call is used on nested ifs so I don't have to deal with the balancing
> of the conditional commands.

> For all I know, there may be some additional cc-mode features I could
> take advantage of to help solve this problem.

Possibly the WITH-ELSE parameter to c-scan-conditionals might be useful.

> Eric

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]