From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric M. Ludlam" Newsgroups: gmane.emacs.devel Subject: Re: Semantic parser uses c-forward-conditional Date: Wed, 23 Sep 2009 07:22:56 -0400 Message-ID: <1253704976.10118.101.camel@projectile.siege-engine.com> References: <87zl8oumvl.fsf@stupidchicken.com> <20090922105735.GA3722@muc.de> <20090923092432.GA2372@muc.de> Reply-To: eric@siege-engine.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1253706442 5457 80.91.229.12 (23 Sep 2009 11:47:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Sep 2009 11:47:22 +0000 (UTC) Cc: cyd@stupidchicken.com, "Eric M. Ludlam" , Richard Stallman , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 23 13:47:14 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MqQJJ-0005Nz-PD for ged-emacs-devel@m.gmane.org; Wed, 23 Sep 2009 13:47:02 +0200 Original-Received: from localhost ([127.0.0.1]:48234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqQJJ-0004da-7X for ged-emacs-devel@m.gmane.org; Wed, 23 Sep 2009 07:47:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqPwA-0005E9-22 for emacs-devel@gnu.org; Wed, 23 Sep 2009 07:23:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqPw8-0005DL-9T for emacs-devel@gnu.org; Wed, 23 Sep 2009 07:23:05 -0400 Original-Received: from [199.232.76.173] (port=59776 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqPw8-0005DI-26 for emacs-devel@gnu.org; Wed, 23 Sep 2009 07:23:04 -0400 Original-Received: from static-71-184-83-10.bstnma.fios.verizon.net ([71.184.83.10]:41607 helo=projectile.siege-engine.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MqPvy-0001Xg-SH; Wed, 23 Sep 2009 07:22:55 -0400 Original-Received: from projectile.siege-engine.com (localhost [127.0.0.1]) by projectile.siege-engine.com (8.14.3/8.14.3/Debian-6) with ESMTP id n8NBMvkG013627; Wed, 23 Sep 2009 07:22:57 -0400 Original-Received: (from zappo@localhost) by projectile.siege-engine.com (8.14.3/8.14.3/Submit) id n8NBMuag013626; Wed, 23 Sep 2009 07:22:56 -0400 X-Authentication-Warning: projectile.siege-engine.com: zappo set sender to eric@siege-engine.com using -f In-Reply-To: <20090923092432.GA2372@muc.de> X-Mailer: Evolution 2.26.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115544 Archived-At: On Wed, 2009-09-23 at 09:24 +0000, Alan Mackenzie wrote: > Hi, Richard and Eric! > > On Wed, Sep 23, 2009 at 02:30:18AM -0400, Richard Stallman 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? > > > Since that would be meant as a command for other programs to use, > > and not merely a subroutine, it would be better to give it a name > > that fits. > > Um, well, thanks for the suggestion. ;-) > > 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 It would not greatly affect my code if some new function moved the point, or just returned where the end is. 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. Eric