From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.bugs Subject: 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__43757.0367743776$1218439728$gmane$org@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> Reply-To: Ulrich Mueller , 636@emacsbugs.donarmstrong.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 1218439670 7873 80.91.229.12 (11 Aug 2008 07:27:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2008 07:27:50 +0000 (UTC) Cc: Michael Olson , 636@emacsbugs.donarmstrong.com, Alan Mackenzie , emacs-devel@gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 11 09:28:40 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KSRpR-0003yY-FU for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 09:28:33 +0200 Original-Received: from localhost ([127.0.0.1]:43015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSRoV-0008Pc-Fp for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 03:27:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSRoQ-0008NZ-LI for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 03:27:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSRoO-0008LP-Pv for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 03:27:29 -0400 Original-Received: from [199.232.76.173] (port=46263 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSRoO-0008L6-AL for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 03:27:28 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:12144) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KSRoN-0004rT-Rb for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 03:27:28 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSRoM-0006Rf-L8 for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 03:27:26 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7B7ROVL013441; Mon, 11 Aug 2008 00:27:24 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7B7P4pp012224; Mon, 11 Aug 2008 00:25:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Ulrich Mueller Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 11 Aug 2008 07:25:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 636 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 636-submit@emacsbugs.donarmstrong.com id=B636.121843913710561 (code B ref 636); Mon, 11 Aug 2008 07:25:04 +0000 Original-Received: (at 636) by emacsbugs.donarmstrong.com; 11 Aug 2008 07:18:57 +0000 Original-Received: from a1iwww1.kph.uni-mainz.de (a1iwww1.kph.uni-mainz.de [134.93.134.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7B7IrSl010554 for <636@emacsbugs.donarmstrong.com>; Mon, 11 Aug 2008 00:18:55 -0700 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, 3) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Mon, 11 Aug 2008 03:27:29 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19281 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