[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#2379: [PATCH?] lisp.el: beginning-of-defun
From: |
Aaron S. Hawley |
Subject: |
bug#2379: [PATCH?] lisp.el: beginning-of-defun |
Date: |
Thu, 19 Feb 2009 23:27:33 -0500 |
Hey Stefan. Thanks for the reply.
>> - (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).
Yes, I had noticed sloppy programming got lucky.
> 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.
Fair enough.
I notice that C-0 M-x end-of-defun is the same as just regular M-x
end-of-defun. Also, It's worth citing beginning-of-line's behavior
here, since it departs by moving in the oppisite direction -- N-1+i.
Anyway, I'm just surprised this critical code for Lisp support is this sloppy.
Cheers,
/a