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: Fri, 15 Dec 2006 11:08:43 -0500 Message-ID: <878xh987lg.fsf@stupidchicken.com> References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1166198946 28009 80.91.229.10 (15 Dec 2006 16:09:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Dec 2006 16:09:06 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 15 17:09:04 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 1GvFcG-0007gX-QI for ged-emacs-devel@m.gmane.org; Fri, 15 Dec 2006 17:08:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GvFcG-0008K8-8z for ged-emacs-devel@m.gmane.org; Fri, 15 Dec 2006 11:08:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GvFc2-0008Gp-WF for emacs-devel@gnu.org; Fri, 15 Dec 2006 11:08:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GvFc2-0008Fx-Du for emacs-devel@gnu.org; Fri, 15 Dec 2006 11:08:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GvFc1-0008Fq-Vu for emacs-devel@gnu.org; Fri, 15 Dec 2006 11:08:42 -0500 Original-Received: from [18.19.1.138] (helo=cyd.mit.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GvFbz-0000zj-Ny for emacs-devel@gnu.org; Fri, 15 Dec 2006 11:08:40 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id EF5CE4E457; Fri, 15 Dec 2006 11:08:43 -0500 (EST) Original-To: "Sean O'Rourke" In-Reply-To: (Sean O'Rourke's message of "Thu\, 14 Dec 2006 22\:31\:37 -0800") 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:63783 Archived-At: "Sean O'Rourke" writes: > Richard Stallman writes: >> Should C mode do (setq beginning-of-defun-function >> 'c-beginning-of-defun) Is there any reason that would be bad? > > As the code currently stands, this goes into infinite recursion > when c-beginning-of-defun calls beginning-of-defun (likewise for > end-of-defun{,-function}). I've fixed this locally by > let-binding {beginning,end}-of-defun-function, which seems like a > reasonable solution (attached). This binding should take place in CC-mode code; there's no reason to expect all beginning-of-defun functions to run with beginning-of-defun-function rebound to nil.