From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: C++ mode and c-beginning-of-current-token Date: Thu, 17 May 2007 16:45:13 +0200 Message-ID: <464C6A79.50307@gmx.at> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070103080302010107070306" X-Trace: sea.gmane.org 1179413210 4348 80.91.229.12 (17 May 2007 14:46:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 17 May 2007 14:46:50 +0000 (UTC) Cc: acm@muc.de, Herbert Euler , handa@m17n.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 17 16:46:48 2007 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 1HohFc-0008LR-UP for ged-emacs-devel@m.gmane.org; Thu, 17 May 2007 16:46:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HohNj-0007b4-49 for ged-emacs-devel@m.gmane.org; Thu, 17 May 2007 10:55:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HohNf-0007aw-A8 for emacs-devel@gnu.org; Thu, 17 May 2007 10:55:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HohNd-0007aM-G5 for emacs-devel@gnu.org; Thu, 17 May 2007 10:55:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HohNd-0007aJ-Cu for emacs-devel@gnu.org; Thu, 17 May 2007 10:55:01 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1HohFW-00080t-6H for emacs-devel@gnu.org; Thu, 17 May 2007 10:46:38 -0400 Original-Received: (qmail invoked by alias); 17 May 2007 14:46:36 -0000 Original-Received: from N752P013.adsl.highway.telekom.at (EHLO [62.47.37.237]) [62.47.37.237] by mail.gmx.net (mp041) with SMTP; 17 May 2007 16:46:36 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18VK7pNG3oVn6lYZndmBFWXDSeL+OsUEq4DLNIUpt dx2xmnyua1O+2H User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:71252 Archived-At: This is a multi-part message in MIME format. --------------070103080302010107070306 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > Also, it is important to update the syntax-table only after making sure that > the new position is valid. So I believe the patch below is what we want. > > > Stefan > > > --- orig/src/syntax.c > +++ mod/src/syntax.c > @@ -1691,10 +1691,10 @@ > p = GPT_ADDR; > stop = endp; > } > + UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1); > if (! fastmap[(int) SYNTAX (p[-1])]) > break; > p--, pos--; > - UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1); > } > } > } Indeed, though I'd prefer the attached one. BTW, did you look at the backward-word problem I mentioned in my previous mail? --------------070103080302010107070306 Content-Type: text/plain; name="syntax.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="syntax.patch" *** syntax.c Wed Jan 17 09:31:10 2007 --- syntax.c Thu May 17 15:23:24 2007 *************** *** 1669,1678 **** p = GPT_ADDR; stop = endp; } - if (! fastmap[(int) SYNTAX (p[-1])]) - break; p--, pos--; ! UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1); } } } --- 1669,1681 ---- p = GPT_ADDR; stop = endp; } p--, pos--; ! UPDATE_SYNTAX_TABLE_BACKWARD (pos); ! if (! fastmap[(int) SYNTAX (*p)]) ! { ! p++, pos++; ! break; ! } } } } --------------070103080302010107070306 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------070103080302010107070306--