From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?iso-8859-1?q?R=F6hler?= Newsgroups: gmane.emacs.devel Subject: Useless change in lisp.el? Date: Sun, 25 Nov 2007 17:55:50 +0100 Message-ID: <200711251755.50891.andreas.roehler@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1196009974 19985 80.91.229.12 (25 Nov 2007 16:59:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2007 16:59:34 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 25 17:59:41 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 1IwKpR-0007p8-5j for ged-emacs-devel@m.gmane.org; Sun, 25 Nov 2007 17:59:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwKpC-0000n8-G3 for ged-emacs-devel@m.gmane.org; Sun, 25 Nov 2007 11:59:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IwKp8-0000kT-NG for emacs-devel@gnu.org; Sun, 25 Nov 2007 11:59:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IwKp7-0000jG-ML for emacs-devel@gnu.org; Sun, 25 Nov 2007 11:59:14 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwKp7-0000iv-Co for emacs-devel@gnu.org; Sun, 25 Nov 2007 11:59:13 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.183]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IwKp6-0003NE-FK for emacs-devel@gnu.org; Sun, 25 Nov 2007 11:59:12 -0500 Original-Received: from noname (p54BEA55D.dip0.t-ipconnect.de [84.190.165.93]) by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis) id 0MKxQS-1IwKp41GoB-0001V5; Sun, 25 Nov 2007 17:59:10 +0100 User-Agent: KMail/1.9.5 Content-Disposition: inline X-Provags-ID: V01U2FsdGVkX1/GiJlja+8AqQLFP03XecbRPQctZNdW9aCMco8 q4dHO/9iLSvKWr9oV2eobZW1JAbqvTCMoaXd33BnBmt/nH4F8L jzPb/KZMXlyFgTSVe5pQg== X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) 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:84118 Archived-At: I doubt if the change seen in [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp.el,v Changes by:Stefan Monnier 07/11/22 22:12:22 is valid. It don't add any functionality AFAIS. As arguments given for it are wrong AFAIU, it might lead to confusion. +++ lisp/emacs-lisp/lisp.el22 Nov 2007 22:12:20 -00001.81 @@ -175,9 +175,10 @@ if defining `defun-prompt-regexp' is not sufficient to handle the mode's needs. =2DThe function (of no args) should go to the line on which the current =2Ddefun starts, and return non-nil, or should return nil if it can't =2Dfind 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. 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. 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. (defun beginning-of-defun (&optional arg) "Move backward to the beginning of a defun. @@ -218,12 +219,22 @@ (unless arg (setq arg 1)) (cond (beginning-of-defun-function + (condition-case nil + (funcall beginning-of-defun-function arg) + ;; We used to define beginning-of-defun-function as taking no argument + ;; but that makes it impossible to implement correct forward motion: + ;; 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. As `beginning-of-defun-function' together with `end-of-defun-function' are freely to design, progmodes could do that at their will. See BTW `she-beg-end.el' in source-list. Adding an `arg' here don't touch that question. + ;; In case the beginning-of-defun-function uses the old calling + ;; convention, fallback on the old implementation. + (wrong-number-of-arguments (if (> arg 0) (dotimes (i arg) (funcall beginning-of-defun-function)) ;; Better not call end-of-defun-function directly, in case ;; it's not defined. =2D (end-of-defun (- arg)))) + (end-of-defun (- arg)))))) Here an unnecessary complication comes in together with a provision for jus= t=20 that complication. In the result we have may have two instances aiming the same arg and extra need to look, where the argument is set. =20 Thanks Andreas R=F6hler