GNU bug report logs -
#2379
[PATCH?] lisp.el: beginning-of-defun
Previous Next
Full log
View this message in rfc822 format
> There's some strange programming style in `beginning-of-defun-raw' for
> Emacs 22.2, perhaps this is what was meant by the use of this `progn'
> syntax?
> - (progn (goto-char (1- (match-end 0)))) t))
> + (progn (goto-char (1- (match-end 0))) t)))
I think that was the intention. Note that it turns out that the two
forms are equivalent in this context (because goto-char never returns
nil).
> Then, once that is figured out, why doesn't `beginning-of-defun'
> manage zero arguments like many of the movement commands do?
I'd rather not touch its behavior for 0. Basically, it should never be
called with a 0 argument (see below).
> Support for a zero argument in these functions is important for
> situations where you want to be programmatic with
> `beginning-of-defun', Can this be fixed?
AFAICT, proper support for 0 would require a serious rethink of BOD's
semantics: currently if you're inside defun number N, then (BOD i) moves
to (N-(i-1)) is i is positive and to (N-i) if i is negative. I.e. it
moves to N if i=1 and to N+1 if i=-1, so where should 0 move to: there
is no other defun between those two.
Stefan
This bug report was last modified 16 years and 91 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.