emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange behavior of (beginning-of-defun 0)


From: Marcin Borkowski
Subject: Re: Strange behavior of (beginning-of-defun 0)
Date: Wed, 22 Feb 2017 10:13:29 +0100
User-agent: mu4e 0.9.19; emacs 26.0.50.5

On 2017-02-08, at 06:29, Marcin Borkowski <address@hidden> wrote:

> Hi all,
>
> put this in an Elisp buffer:
>
> --8<---------------cut here---------------start------------->8---
> (defun a ()
>   nil)
> -!-(defun b ()
>   nil)
> --8<---------------cut here---------------end--------------->8---
>
> put the point where the -!- is (of course, "-!-" is only a marker and
> should not be in the buffer;-)) and say M-: (beginning-of-defun 0) (or
> C-u 0 C-M-a).  The point goes up one line.
>
> Is that intended?  Is the behavior of (beginning-of-defun 0) defined at
> all?

Hi all,

I spent a few minutes looking into this, and it seems that while a test
for zero argument is actually present in `beginning-of-defun-raw', it
(a) is (imho) located in the wrong place (too late in the `cond') and
(b) returns t instead of nil (so that `beginning-of-defun' moves to the
bol instead of not moving the point at all).  So, here's a patch
correcting this.  WDYT?

Best,

--
Marcin Borkowski

Attachment: 0001-Fix-beginning-of-defun-raw-0.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]