From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?UTF-8?Q?R=C3=B6hler?= Newsgroups: gmane.emacs.bugs Subject: bug#17247: 24.4.50; end-of-defun bug in elisp Date: Tue, 20 May 2014 09:59:05 +0200 Message-ID: <537B0B49.6000505@easy-emacs.de> References: <53576985.9090305@easy-emacs.de> <87sio5ksio.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1400574628 16018 80.91.229.3 (20 May 2014 08:30:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 May 2014 08:30:28 +0000 (UTC) Cc: 17247@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 20 10:30:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WmeyF-0006Wz-1N for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 May 2014 10:00:23 +0200 Original-Received: from localhost ([::1]:51755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmeyE-00029Z-MQ for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 May 2014 04:00:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmey5-00025i-Mx for bug-gnu-emacs@gnu.org; Tue, 20 May 2014 04:00:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wmexw-0002HM-EZ for bug-gnu-emacs@gnu.org; Tue, 20 May 2014 04:00:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmexw-0002Fs-Ap for bug-gnu-emacs@gnu.org; Tue, 20 May 2014 04:00:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wmexv-00089b-H0 for bug-gnu-emacs@gnu.org; Tue, 20 May 2014 04:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 May 2014 08:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17247 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17247-submit@debbugs.gnu.org id=B17247.140057277431280 (code B ref 17247); Tue, 20 May 2014 08:00:03 +0000 Original-Received: (at 17247) by debbugs.gnu.org; 20 May 2014 07:59:34 +0000 Original-Received: from localhost ([127.0.0.1]:53809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WmexR-00088R-Dy for submit@debbugs.gnu.org; Tue, 20 May 2014 03:59:33 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.187]:52686) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WmexN-000887-8q for 17247@debbugs.gnu.org; Tue, 20 May 2014 03:59:31 -0400 Original-Received: from [192.168.178.32] (brln-4dba0fd7.pool.mediaWays.net [77.186.15.215]) by mrelayeu.kundenserver.de (node=mreue005) with ESMTP (Nemesis) id 0M6RLT-1Wx2tW0f0t-00yT1O; Tue, 20 May 2014 09:59:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.5.0 In-Reply-To: <87sio5ksio.fsf@yandex.ru> X-Provags-ID: V02:K0:daj9s0Qd9zuBZcR6RLeIhwcG/3Ft0HHZ6o/2UG92LYd ZdRW9+s5Ugx74UuUVG/ycUie63IFIvJrKJLH/FnKaqDL9k+ct0 z//nQPoA9EQgKwmOaNjt079YjMzChu8wXNSpk3Ju138Yh+Gbl0 mm/hc0s6g30XWr/MY0JfAIJJI1JpGdnN0ObVdh8mi/64ksO0Vl tlI4HmrTQauG9Dazuj+awaNC/wrZi90Hx9Szo6sa5GshylqZMv wHTGmgGaOfsFIhRDBF12ZLI1gA5wysY5ZByLVpk3gjUoToA77a VoGaOUbj0dPrXOtebGmrJmnIodvUcj+DXW9QzcFYoB1eb72141 WZljI+Ow3jqwgcWXC/DAAbARSPcUdpaoNVbR9tT/c X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:89269 Archived-At: On 20.05.2014 06:01, Dmitry Gutov wrote: > Andreas Röhler writes: > >> May confirm that for 24.3.90.1-pretest >> >> Looks like line 407 >> >> (beginning-of-defun-raw (- arg)) >> >> must read >> >> (beginning-of-defun-raw (abs arg)) >> >> because it's already decided at that point going backward, so the arg must be positiv for a "beginning-..." >> function. > > `arg' is negative in that clause, so (abs arg) is the same as (- arg). > Haven't you tried your suggestion? > Just had a look into the code, my mistake, sorry. > Anyway, the patch below seems to work fine. Not sure what the purpose of > `end-of-line' was there. > AFAIU the purpose is to make sure the beginning of current defun is fetched, not the previous one, i.e. protect for cases, point is at the beginning of defun. From there some doubts... untested :) > > === modified file 'lisp/emacs-lisp/lisp.el' > --- lisp/emacs-lisp/lisp.el 2014-02-26 02:31:27 +0000 > +++ lisp/emacs-lisp/lisp.el 2014-05-20 03:58:27 +0000 > @@ -373,7 +373,7 @@ > (push-mark)) > (if (or (null arg) (= arg 0)) (setq arg 1)) > (let ((pos (point)) > - (beg (progn (end-of-line 1) (beginning-of-defun-raw 1) (point)))) > + (beg (progn (beginning-of-defun-raw 1) (point)))) > (funcall end-of-defun-function) > ;; When comparing point against pos, we want to consider that if > ;; point was right after the end of the function, it's still > > IMHO that end-of-defun section is over-engineered, thus bug-sourcing. For example the common design-logic when taking numeric arguments: with positiv go forward, with negativ backward, resp. negate assumed direction. This seems broken internally by (funcall end-of-defun-function), which doesn't care for arguments. While later on with (cond ((> arg 0)... it takes places as to expect, but has to deal with the effects by previous funcall.