From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Useless change in lisp.el? Date: Mon, 26 Nov 2007 10:09:38 -0500 Message-ID: References: <200711251755.50891.andreas.roehler@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196089878 15884 80.91.229.12 (26 Nov 2007 15:11:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Nov 2007 15:11:18 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas =?iso-8859-1?Q?R=F6hler?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 26 16:11:26 2007 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 1Iwfc1-00068C-Iw for ged-emacs-devel@m.gmane.org; Mon, 26 Nov 2007 16:11:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iwfbm-000869-Je for ged-emacs-devel@m.gmane.org; Mon, 26 Nov 2007 10:10:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iwfbj-000863-3S for emacs-devel@gnu.org; Mon, 26 Nov 2007 10:10:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iwfbi-00085p-6y for emacs-devel@gnu.org; Mon, 26 Nov 2007 10:10:46 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iwfbi-00085m-0b for emacs-devel@gnu.org; Mon, 26 Nov 2007 10:10:46 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iwfbh-0005bH-QY for emacs-devel@gnu.org; Mon, 26 Nov 2007 10:10:45 -0500 Original-Received: from ceviche.home (vpn-132-204-232-58.acd.umontreal.ca [132.204.232.58]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id lAQFAiRk014794 for ; Mon, 26 Nov 2007 10:10:44 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id ECD16B42E5; Mon, 26 Nov 2007 10:09:38 -0500 (EST) In-Reply-To: <200711251755.50891.andreas.roehler@online.de> ("Andreas =?iso-8859-1?Q?R=F6hler=22's?= message of "Sun, 25 Nov 2007 17:55:50 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-NAI-Spam-Score: -2.5 X-NAI-Spam-Rules: 2 Rules triggered BAYES_00=-2.5, HAS_X_HELO=0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:84140 Archived-At: > -The function (of no args) should go to the line on which the current > -defun starts, and return non-nil, or should return nil if it can't > -find the beginning.") > +The function takes the same argument as `beginning-of-defun' and should > +behave similarly, returning non-nil if it found the beginning of a defun. > +Ideally it should move to a point right before an open-paren which encloses > +the body of the defun.") > As `beginning-of-defun-function' expressivly is > introduced for all possible function definitions, it > makes no sence to require or even to mention an open > paren. Sure it does: end-of-defun does basically "(progn (beginning-of-defun-raw) (forward-sexp)", so if beginning-of-defun-function stops right before an "open paren", end-of-defun will do the right thing. Otherwise, the programmer will have to supply his own end-of-defun-function. Note that since forward-sexp can be customized with forward-sexp-function, the notion of "open paren" may include things like "begin...end". [ Yes, I know end-of-defun currently doesn't always use forward-sexp, I'm working on fixing that. ] If you see how to improve the doc to make this more clear, patches are welcome. > Other languages are completely free to design function > definitions. Emacs should be able to follow them without specifying > things no one may know at this time. Indeed. I did not write that the function *must* do it, just that it should ideally do that. > Too I pointed just these days at the fact, `beginning-of-defun' will > be understood as top-level-form here rather than strictly > a function-beginning. Agreed. I tried to keep this in mind when writing the above text, but again, if you see a way to make it more clear, go for it. > + ;; we used to use end-of-defun for that, but it's not supposed to do > + ;; the same thing (it moves to the end of a defun not to the beginning > + ;; of the next). > That's not the case. Yes it is: try it in elisp-mode (with enough empty lines between defuns that the difference caqn be noticed, of course). > As `beginning-of-defun-function' together with `end-of-defun-function' > are freely to design, progmodes could do that at their will. No: end-of-defun can't know that it's called by beginning-of-defun. Stefan