From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: end-of-defun is fubsr. Date: Fri, 13 Feb 2009 16:42:10 +0000 Message-ID: <20090213164210.GC2975@muc.de> References: <20090203185812.GH1396@muc.de> <20090204001445.GI1396@muc.de> <20090204133728.GB1049@muc.de> <20090204154427.GD1049@muc.de> <20090213110819.GA2975@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1234542104 26227 80.91.229.12 (13 Feb 2009 16:21:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Feb 2009 16:21:44 +0000 (UTC) Cc: Miles Bader , =?iso-8859-1?Q?R=F6hler?= , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 13 17:22:58 2009 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 1LY0oa-00079a-1I for ged-emacs-devel@m.gmane.org; Fri, 13 Feb 2009 17:22:56 +0100 Original-Received: from localhost ([127.0.0.1]:36025 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LY0nG-0001mm-3j for ged-emacs-devel@m.gmane.org; Fri, 13 Feb 2009 11:21:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LY0nB-0001mO-Ek for emacs-devel@gnu.org; Fri, 13 Feb 2009 11:21:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LY0n9-0001lG-Pd for emacs-devel@gnu.org; Fri, 13 Feb 2009 11:21:29 -0500 Original-Received: from [199.232.76.173] (port=57083 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LY0n9-0001lD-NE for emacs-devel@gnu.org; Fri, 13 Feb 2009 11:21:27 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:2935 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LY0n9-0000oy-8U for emacs-devel@gnu.org; Fri, 13 Feb 2009 11:21:27 -0500 Original-Received: (qmail 9005 invoked by uid 3782); 13 Feb 2009 16:21:24 -0000 Original-Received: from acm.muc.de (pD9E23940.dip.t-dialin.net [217.226.57.64]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 13 Feb 2009 17:21:21 +0100 Original-Received: (qmail 9855 invoked by uid 1000); 13 Feb 2009 16:42:10 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:109045 Archived-At: [N.B. There is no Andreas@muc.de] Hi, Stefan, On Fri, Feb 13, 2009 at 09:31:19AM -0500, Stefan Monnier wrote: > > If point also begins somewhere in the inter-defun WS, after calling > > BOD-function and EOD-function, it will land back at an arbitrary place > > in the same WS, which may be before, at, or after the starting point. > It's not arbitrary: it's carefully chosen by the implementor of > [EB]OD-function. An unknown number of implementors of EOD-functions will have chosen carefully; well, maybe some of them weren't so careful, who knows? The point is, they probably haven't all chosen the "same" place in that WS, for whatever value of "same". Most of them will expect their EOD-functions to work the same in Emacs 23 as Emacs n, n < 23. > If you make your choices arbitrarily, you get what you ask for, of > course ;-) No. The whole point of Miles's bug report was that he DIDN'T get what he asked for, neither did he get what c-end-of-defun asked for. > I.e. "notabug" (or at least "wontfix") for what I can see. > Did you notice any other problem? Well, the ones I pointed out before: (i) The meaning of end-of-defun-function has been radically changed, so that uses and definitions of them pre- and post- Emacs-23 will no longer be compatible with eachother. The Emacs 23 handling of this variable isn't compatible with its docstring in Emacs 22, which states that the EOD-function is used when the "normal method" is not appropriate. (ii) The symmetry between beginning/end-of-defun-function has been broken, which will lead to confusion. How about renaming `end-of-defun-function' to, say, `forward-defun-function', thus precluding any possible confusion? (iii) Infinite recursion will occur if an existing BOD-function with -ve argument calls EOD-function. I don't know if this happens. If so, I think it would have happend in Emacs 22 too. (iv) The way things are done introduces the unnecessary restriction that BODs and EODs alternate strictly in a source file. Although this is virtually universally true, it might not be in a language which defined EOD as a match for "^)", for example, as Elisp could well have done. It might also constrain a major mode's handling of nested defuns, though I haven't got the energy to think this through at the moment. (v) Most of all, using BOD/EOD-function is so difficult to understand that it's more work than just binding C-M-[aeh] in a major-mode map, even if starting from scratch. Additionally, not all the doc strings are optimal, but that doesn't seem particularly urgent at the moment; for example, that for end-of-defun-function says why a function is called, but not what it should do, nor what its result means, nor where it should leave point. > Stefan -- Alan Mackenzie (Nuremberg, Germany).