From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: AW: font-locking and open parens in column 0 Date: Fri, 10 Nov 2006 12:49:40 -0500 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1163181029 24795 80.91.229.2 (10 Nov 2006 17:50:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Nov 2006 17:50:29 +0000 (UTC) Cc: "Mackenzie, Alan" , emacs-devel@gnu.org, rudalics@gmx.at Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 10 18:50:26 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GiaVz-00029X-CP for ged-emacs-devel@m.gmane.org; Fri, 10 Nov 2006 18:50:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GiaVy-0000nq-W7 for ged-emacs-devel@m.gmane.org; Fri, 10 Nov 2006 12:50:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GiaVm-0000mf-Vg for emacs-devel@gnu.org; Fri, 10 Nov 2006 12:49:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GiaVk-0000lA-EE for emacs-devel@gnu.org; Fri, 10 Nov 2006 12:49:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GiaVk-0000l7-AM for emacs-devel@gnu.org; Fri, 10 Nov 2006 12:49:52 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GiaVj-0001yW-AD; Fri, 10 Nov 2006 12:49:51 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 8326F2CEFEA; Fri, 10 Nov 2006 12:49:50 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 892313FE0; Fri, 10 Nov 2006 12:49:40 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 729BA6C9DB; Fri, 10 Nov 2006 12:49:40 -0500 (EST) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Sat\, 04 Nov 2006 01\:38\:48 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca 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:62047 Archived-At: > Normally a defun starts when there is a char with open-parenthesis > syntax at the beginning of a line. > The purpose of open-paren-in-column-0-is-defun-start is to enable to > disable this heuristic. Setting it to nil disables the heuristic. > So I think his change is correct. Huh? What do you mean by "heuristic". The definition of beginning-of-defun has never used syntax-tables or anything like that. E.g. when defun-prompt-regexp is used it doesn't pay attention to syntax-tables either. open-paren-in-column-0-is-defun-start is only used as a heuristic in syntax.c when skipping backward over comment. There's another related heuristic, which is the use of beginning-of-defun for syntax-begin-function. This one is a heuristic specifically because beginning-of-defun only works with regexps. If we make beginning-of-defun aware of strings and comments, then we'll have to warn every coder who uses it in syntax-begin-function that it's not a good heuristic any more (especially if beginning-of-defun uses syntax-ppss in which case we may get into inf-loops). Stefan