From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#636: Please fix before the release of 23.1 Date: Mon, 11 Aug 2008 08:47:08 +0000 Message-ID: <20080811084708.GA3219__37608.3427960568$1218446167$gmane$org@muc.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> <18591.59359.40969.641357@a1ihome1.kph.uni-mainz.de> Reply-To: Alan Mackenzie , 636@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218446109 26309 80.91.229.12 (11 Aug 2008 09:15:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2008 09:15:09 +0000 (UTC) Cc: Chong Yidong , 636@emacsbugs.donarmstrong.com, Michael Olson , emacs-devel@gnu.org To: Ulrich Mueller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 11 11:16:00 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 1KSTVP-0005qV-NV for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 11:16:00 +0200 Original-Received: from localhost ([127.0.0.1]:35284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSTUR-0005xq-Jt for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 05:14:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSTNC-0004c0-OP for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 05:07:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSTNA-0004bC-BA for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 05:07:29 -0400 Original-Received: from [199.232.76.173] (port=51714 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSTN9-0004b1-MF for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 05:07:27 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:38847) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KSTN8-0008PG-G6 for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 05:07:27 -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 m7B97ODD011858; Mon, 11 Aug 2008 02:07:24 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7B8t49n006984; Mon, 11 Aug 2008 01:55:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Alan Mackenzie Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 11 Aug 2008 08:55: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.12184443255101 (code B ref 636); Mon, 11 Aug 2008 08:55:04 +0000 Original-Received: (at 636) by emacsbugs.donarmstrong.com; 11 Aug 2008 08:45:25 +0000 Original-Received: from mail.muc.de (qmailr@colin.muc.de [193.149.48.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7B8jLEj005095 for <636@emacsbugs.donarmstrong.com>; Mon, 11 Aug 2008 01:45:22 -0700 Original-Received: (qmail 64731 invoked by uid 3782); 11 Aug 2008 08:45:19 -0000 Original-Received: from acm.muc.de (pD9E50E2A.dip.t-dialin.net [217.229.14.42]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 11 Aug 2008 10:45:17 +0200 Original-Received: (qmail 3345 invoked by uid 1000); 11 Aug 2008 08:47:08 -0000 Content-Disposition: inline In-Reply-To: <18591.59359.40969.641357@a1ihome1.kph.uni-mainz.de> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Mon, 11 Aug 2008 05:07:28 -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:19283 Archived-At: Hi, Ulrich and Yidong! Thanks for CC'ing me in on this one. On Mon, Aug 11, 2008 at 09:18:55AM +0200, Ulrich Mueller wrote: > >>>>> On Sun, 10 Aug 2008, Chong Yidong wrote: > > 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")) I protest against this "fix". :-) Not against the fix as such (though it is somewhat ugly, and would need some comments), just that the bug it fixes is not understood. Therefore, it is NOT a fix. It is still a bug, which will cause pain somewhere else. > Ulrich -- Alan Mackenzie (Nuremberg, Germany).