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: AW: font-locking and open parens in column 0 Date: Sun, 12 Nov 2006 20:45:03 +0100 Message-ID: <455779BF.8050802@gmx.at> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1163361022 22622 80.91.229.2 (12 Nov 2006 19:50:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 12 Nov 2006 19:50:22 +0000 (UTC) Cc: AMackenzie@harmanbecker.com, Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 12 20:50:21 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 1GjLLL-0008CJ-QU for ged-emacs-devel@m.gmane.org; Sun, 12 Nov 2006 20:50:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjLLL-0001Wb-5P for ged-emacs-devel@m.gmane.org; Sun, 12 Nov 2006 14:50:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GjLKU-0001GV-3k for emacs-devel@gnu.org; Sun, 12 Nov 2006 14:49:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GjLKT-0001G8-JB for emacs-devel@gnu.org; Sun, 12 Nov 2006 14:49:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjLKT-0001Fx-9Q for emacs-devel@gnu.org; Sun, 12 Nov 2006 14:49:21 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1GjLKT-0005cd-1e for emacs-devel@gnu.org; Sun, 12 Nov 2006 14:49:21 -0500 Original-Received: (qmail invoked by alias); 12 Nov 2006 19:49:19 -0000 Original-Received: from N819P015.adsl.highway.telekom.at (EHLO [62.47.46.79]) [62.47.46.79] by mail.gmx.net (mp037) with SMTP; 12 Nov 2006 20:49:19 +0100 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: rms@gnu.org In-Reply-To: X-Y-GMX-Trusted: 0 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:62128 Archived-At: > However, I did not realize that CC mode actually used that case. I > thought it had a beginning-of-defun-function. I was surprised just > now to see that it didn't have one. Perhaps that should be changed. I've been asking before why c-mode cannot use `c-beginning-of-defun' here. Is it because syntax-table properties haven't been set up? I recall invoking `c-beginning-of-defun' in arbitrary not yet fontified text and getting strange results. > However, taking out the use of syntax-ppss in beginning-of-defun-raw > isn't the right way to get good behavior in CC mode. That would only > make it parse from the start of the file every time. When scrolling through a buffer backwards, the current patch will cause parsing from bob every time I scroll. > (In any case, such a problem won't arise in Emacs Lisp mode, since > open-paren-in-column-0-is-defun-start = t.) `open-paren-in-column-0-is-defun-start' is a user option. > A reliable way to get behavior 1 is to use syntax-ppss rather than > beginning-of-defun. > > That is a good point. Maybe some uses of beginning-of-defun > (such as in Font Lock) ought to use syntax-ppss instead. This would introduce a circular dependency since `syntax-ppss' may call `beginning-of-defun'. > The proposed patch basically tries to make beginning-of-defun follow the > behavior number 1 and to make it do so reliably. > > I don't see it that way. I see it Stefan's way.