From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw. Date: Sat, 16 Dec 2006 14:33:59 -0500 Message-ID: <87hcvvzlco.fsf@stupidchicken.com> References: <45768797.5010106@gmx.at> <87odqhj89q.fsf@stupidchicken.com> <20061210014526.GB3738@muc.de> <877ix0lfm8.fsf@furball.mit.edu> <20061210102249.GA1235@muc.de> <87d56rpk7a.fsf@stupidchicken.com> <20061213224009.GA1206@muc.de> <87odq72ssy.fsf@stupidchicken.com> <20061214084713.GA1333@muc.de> <45812BDF.5050107@gmx.at> <4583C7D3.1070703@gmx.at> <45843AA5.5080906@gmx.at> <45844243.4060706@gmx.at> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1166297657 3857 80.91.229.10 (16 Dec 2006 19:34:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Dec 2006 19:34:17 +0000 (UTC) Cc: Alan Mackenzie , emacs-devel@gnu.org, Stefan Monnier , Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 16 20:34:14 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GvfIM-0005Vh-HX for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2006 20:34:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GvfIM-0002qO-3T for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2006 14:34:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GvfIA-0002oa-3A for emacs-devel@gnu.org; Sat, 16 Dec 2006 14:33:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GvfI8-0002nS-0Q for emacs-devel@gnu.org; Sat, 16 Dec 2006 14:33:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GvfI7-0002nO-NM for emacs-devel@gnu.org; Sat, 16 Dec 2006 14:33:51 -0500 Original-Received: from [18.19.1.138] (helo=cyd.mit.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GvfI5-00022b-PZ; Sat, 16 Dec 2006 14:33:49 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 8BF3D4E44F; Sat, 16 Dec 2006 14:33:59 -0500 (EST) Original-To: martin rudalics In-Reply-To: <45844243.4060706@gmx.at> (martin rudalics's message of "Sat\, 16 Dec 2006 20\:00\:19 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) 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:63843 Archived-At: martin rudalics writes: > To elaborate on my last mail: I think the bug is in back_comment and may > affect any mode setting `open-paren-in-column-0-is-defun-start' to nil. > My gdb is currently on strike, so could someone please try to debug > where back_comment spends its time when applying scan_lists to > syms_of_xdisp? Maybe there's an easy solution. > > Otherwise we'll have to set `open-paren-in-column-0-is-defun-start' to t > in C mode until someone fixes this. It's the part in syntax.c:701 which says /* If we did not already find the defun start, find it now. */ if (defun_start == 0) { defun_start = find_defun_start (comment_end, comment_end_byte); defun_start_byte = find_start_value_byte; } The trouble is that find_defun_start will scan from bob if open_paren... is 0: static int find_defun_start (pos, pos_byte) int pos, pos_byte; { ... if (!open_paren_in_column_0_is_defun_start) { find_start_value_byte = BEGV_BYTE; return BEGV; }