GNU bug report logs - #2379
[PATCH?] lisp.el: beginning-of-defun

Previous Next

Package: emacs;

Reported by: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>

Date: Thu, 19 Feb 2009 02:45:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 2379 <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
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




This bug report was last modified 16 years and 92 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.