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 23:40:52 +0200 Message-ID: <464CCBE4.9030209@gmx.at> References: <464C5DE4.1010500@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030603090304010605090705" X-Trace: sea.gmane.org 1179438116 3166 80.91.229.12 (17 May 2007 21:41:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 17 May 2007 21:41:56 +0000 (UTC) Cc: acm@muc.de, Herbert Euler , handa@m17n.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 17 23:41:52 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 1HonjK-0001UX-DN for ged-emacs-devel@m.gmane.org; Thu, 17 May 2007 23:41:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HonrS-0001U7-5c for ged-emacs-devel@m.gmane.org; Thu, 17 May 2007 17:50:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HonrN-0001Om-MM for emacs-devel@gnu.org; Thu, 17 May 2007 17:50:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HonrM-0001M0-Ht for emacs-devel@gnu.org; Thu, 17 May 2007 17:50:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HonrM-0001Lo-5h for emacs-devel@gnu.org; Thu, 17 May 2007 17:50:08 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1HonjC-0003f8-VE for emacs-devel@gnu.org; Thu, 17 May 2007 17:41:43 -0400 Original-Received: (qmail invoked by alias); 17 May 2007 21:41:41 -0000 Original-Received: from N946P012.adsl.highway.telekom.at (EHLO [62.47.62.44]) [62.47.62.44] by mail.gmx.net (mp015) with SMTP; 17 May 2007 23:41:41 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19wq/0huN5w5/g36JM2iDUzwlvbPhKvLf/oDZDtnE JagB3LxZ4o+jLs User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: <464C5DE4.1010500@gmx.at> 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:71277 Archived-At: This is a multi-part message in MIME format. --------------030603090304010605090705 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > I do have my own problems with UPDATE_SYNTAX_TABLE_BACKWARD. To > reproduce with Emacs -Q define foo as > > (defun foo () > (interactive) > (put-text-property (1- (point)) (point) 'syntax-table '(2)) > (setq parse-sexp-lookup-properties t)) > > open a text-mode buffer, insert a couple of non-word chars in the > buffer, leave point after them, and type M-x foo followed by M-b. On my > system it goes back by _two_ characters instead of one. I'm yet too > silly to understand what's going on. The attached patch seems to fix both the syntax and word backward scanning problems. Could someone please try? --------------030603090304010605090705 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 23:30:50 2007 *************** *** 1276,1294 **** position of it. */ while (1) { - int temp_byte; - if (from == beg) break; ! temp_byte = dec_bytepos (from_byte); UPDATE_SYNTAX_TABLE_BACKWARD (from); ! ch0 = FETCH_CHAR (temp_byte); code = SYNTAX (ch0); if (!(words_include_escapes && (code == Sescape || code == Scharquote))) if (code != Sword || WORD_BOUNDARY_P (ch0, ch1)) ! break; ! DEC_BOTH (from, from_byte); ch1 = ch0; } count++; --- 1276,1294 ---- position of it. */ while (1) { if (from == beg) break; ! DEC_BOTH (from, from_byte); UPDATE_SYNTAX_TABLE_BACKWARD (from); ! ch0 = FETCH_CHAR (from_byte); code = SYNTAX (ch0); if (!(words_include_escapes && (code == Sescape || code == Scharquote))) if (code != Sword || WORD_BOUNDARY_P (ch0, ch1)) ! { ! INC_BOTH (from, from_byte); ! break; ! } ch1 = ch0; } count++; *************** *** 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; ! } } } } --------------030603090304010605090705 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 --------------030603090304010605090705--