From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: C++ mode and c-beginning-of-current-token Date: Mon, 21 May 2007 22:01:55 +0900 Message-ID: References: <464EF4C1.2020505@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1179752753 12941 80.91.229.12 (21 May 2007 13:05:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 May 2007 13:05:53 +0000 (UTC) Cc: rudalics@gmx.at, herberteuler@hotmail.com, emacs-devel@gnu.org, rms@gnu.org, acm@muc.de To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 21 15:05:47 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 1Hq7ZX-0003gw-Sr for ged-emacs-devel@m.gmane.org; Mon, 21 May 2007 15:05:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hq7ZX-0004P1-HQ for ged-emacs-devel@m.gmane.org; Mon, 21 May 2007 09:05:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hq7Wl-0001Fg-NX for emacs-devel@gnu.org; Mon, 21 May 2007 09:02:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hq7Wi-0001CI-0u for emacs-devel@gnu.org; Mon, 21 May 2007 09:02:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hq7Wh-0001C3-PE for emacs-devel@gnu.org; Mon, 21 May 2007 09:02:15 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hq7Wf-0001p8-Tq; Mon, 21 May 2007 09:02:14 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id l4LD1we3000773; Mon, 21 May 2007 22:01:58 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id l4LD1w6s011010; Mon, 21 May 2007 22:01:58 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id l4LD1tv8015316; Mon, 21 May 2007 22:01:55 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.63) (envelope-from ) id 1Hq7WN-00014F-1A; Mon, 21 May 2007 22:01:55 +0900 Sent-via: Stefan Monnier Sent-via: rudalics@gmx.at, rms@gnu.org, acm@muc.de, herberteuler@hotmail.com, emacs-devel@gnu.org In-reply-to: (message from Stefan Monnier on Sat, 19 May 2007 11:18:24 -0400) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.0 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-kernel: Solaris 8 (1) 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:71497 Archived-At: In article , Stefan Monnier writes: > > There are two bugs with identical structure - one in `skip_chars' and > > one in `scan_words'. > I have just installed a patch in EMACS_22_BASE for skip_chars. Thank you. I've just installed the corresponding change in emacs-unicode-2. > As for scan_words, I don't know of such a bug. Also looking at the code, > I don't see it (not that it proves anything, of course). Could you tell me > where's the problem in scan_words? martin rudalics writes: > 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. It > goes back by _two_ characters instead of one. The attached patch was > supposed to fix this and the other problem. I confirmed this bug. It seems that the following single line change is easier to understand what was wrong, but Martin's change makes the resulting code easier to read. *** syntax.c 21 May 2007 21:21:30 +0900 1.205 --- syntax.c 21 May 2007 21:53:50 +0900 *************** *** 1281,1287 **** 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 --- 1281,1287 ---- if (from == beg) break; temp_byte = dec_bytepos (from_byte); ! UPDATE_SYNTAX_TABLE_BACKWARD (from - 1); ch0 = FETCH_CHAR (temp_byte); code = SYNTAX (ch0); if (!(words_include_escapes --- Kenichi Handa handa@m17n.org