From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.devel Subject: Re: bug#636: Please fix before the release of 23.1 Date: Mon, 11 Aug 2008 09:18:55 +0200 Message-ID: <18591.59359.40969.641357@a1ihome1.kph.uni-mainz.de> References: <877ibp4hh3.fsf@vorlon.ganneff.de> <871w1xfmsb.fsf@grepfind.mwolson.org> <87ljzj3oad.fsf_-_@grepfind.mwolson.org> <18590.45488.891078.545308@a1ihome1.kph.uni-mainz.de> <18590.47471.82980.734389@a1ihome1.kph.uni-mainz.de> <87ljz45xfj.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1218439179 6616 80.91.229.12 (11 Aug 2008 07:19:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2008 07:19:39 +0000 (UTC) Cc: Glenn Morris , Michael Olson , 636@emacsbugs.donarmstrong.com, Alan Mackenzie , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 11 09:20:30 2008 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 1KSRhb-0002Gy-AZ for ged-emacs-devel@m.gmane.org; Mon, 11 Aug 2008 09:20:27 +0200 Original-Received: from localhost ([127.0.0.1]:36989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSRgf-00026L-7B for ged-emacs-devel@m.gmane.org; Mon, 11 Aug 2008 03:19:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSRgZ-00022L-QU for emacs-devel@gnu.org; Mon, 11 Aug 2008 03:19:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSRgX-0001zE-Us for emacs-devel@gnu.org; Mon, 11 Aug 2008 03:19:23 -0400 Original-Received: from [199.232.76.173] (port=43590 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSRgX-0001yo-NU for emacs-devel@gnu.org; Mon, 11 Aug 2008 03:19:21 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:11741) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KSRgN-0004L6-MM; Mon, 11 Aug 2008 03:19:11 -0400 Original-Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSRgM-0005TN-Hb; Mon, 11 Aug 2008 03:19:10 -0400 Original-Received: from a1ihome1.kph.uni-mainz.de (a1ihome1.kph.uni-mainz.de [134.93.134.75]) by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id m7B7IlPn024154; Mon, 11 Aug 2008 09:18:47 +0200 Original-Received: from a1ihome1.kph.uni-mainz.de (localhost [127.0.0.1]) by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.1) with ESMTP id m7B7Itv6016438; Mon, 11 Aug 2008 09:18:55 +0200 Original-Received: (from ulm@localhost) by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.0/Submit) id m7B7ItH0016432; Mon, 11 Aug 2008 09:18:55 +0200 X-Mailer: VM 8.0.2-487 under Emacs 22.2.1 (i686-pc-linux-gnu) X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 1) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:102277 Archived-At: >>>>> On Sun, 10 Aug 2008, Chong Yidong wrote: > Thanks for pinpointing this. > In fact, it's apparently not a problem with cc-mode, but with Emacs. > Here's a stripped-down recipe: > 1. Create a file foo.el in your lisp path with the following contents: > (defconst foo > (let ((beginning-of-defun-function > (lambda (&optional arg) > (not (eq arg nil))))) > (progn > (beginning-of-defun 1)))) > (provide 'foo) Calling beginning-of-defun will move point, right? And since beginning-of-defun-function is essentially defined as a no-op, point will just be moved to the beginning-of-line. (In fact, eval-buffer on foo.el results in an infinite loop.) > By the way, replacing `progn' with `save-excursion' makes the bug go > away (this makes cc-def.el work too). Why? I don't know. Indeed. If we agree that the bug is in cc-defs.el, then the following patch should fix it: --- progmodes/cc-defs.el 27 Jun 2008 21:12:46 -0000 1.58 +++ progmodes/cc-defs.el 11 Aug 2008 07:11:04 -0000 @@ -1445,7 +1445,7 @@ (let ((beginning-of-defun-function (lambda (&optional arg) (not (eq arg nil))))) - (if (beginning-of-defun 1) + (if (save-excursion (beginning-of-defun 1)) (setq list (cons 'argumentative-bod-function list)))) (let ((buf (generate-new-buffer " test")) Ulrich