On 2017-02-08, at 06:29, Marcin Borkowski 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