all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 17247@debbugs.gnu.org
Subject: bug#17247: 24.4.50; end-of-defun bug in elisp
Date: Tue, 20 May 2014 09:59:05 +0200	[thread overview]
Message-ID: <537B0B49.6000505@easy-emacs.de> (raw)
In-Reply-To: <87sio5ksio.fsf@yandex.ru>

On 20.05.2014 06:01, Dmitry Gutov wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> 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.









  reply	other threads:[~2014-05-20  7:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-12  6:04 bug#17247: 24.4.50; end-of-defun bug in elisp Leo Liu
2014-04-23  7:19 ` Andreas Röhler
2014-05-20  4:01   ` Dmitry Gutov
2014-05-20  7:59     ` Andreas Röhler [this message]
2014-05-20 12:12       ` Dmitry Gutov
2014-05-20 15:59         ` Andreas Röhler
2014-05-20 16:39           ` Dmitry Gutov
2014-05-20 14:18       ` Stefan Monnier
2014-05-20 16:33         ` Andreas Röhler
2014-05-20 14:20     ` Stefan Monnier
2014-05-20 16:32       ` Dmitry Gutov
2014-05-20 18:56         ` Stefan Monnier
2014-05-21  2:47           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537B0B49.6000505@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=17247@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.