GNU bug report logs -
#8667
24.0.50; `bounds-of-thing-at-point' returns (N . N) for `comment'
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Fri, 13 May 2011 00:47:02 UTC
Severity: normal
Merged with 8670
Found in version 24.0.50
Done: "Drew Adams" <drew.adams <at> oracle.com>
Bug is archived. No further changes may be made.
Full log
Message #52 received at 8667 <at> debbugs.gnu.org (full text, mbox):
> All calls with point elsewhere than before/after a <thingy> behave in
> somewhat arbitrary ways which mostly depend on how the function is
> implemented and what kind of structure <thingies> have (e.g. can they
> nest? Can we easily tell when we're in the middle of a <thingy>?).
That's clearly no good for thing-at-point, in general. `thing-at-point' uses
`bounds-of-thing-at-point', and that uses `forward-THING' in both directions (1,
-1).
`forward-comment' moves point even when there is no comment at point (before or
after). And that causes (thing-at-point 'comment) to return a non-comment
string of text (e.g. only whitespace), instead of nil, when point is not on a
comment.
`thing-at-point' should always return nil or a comment, when THING is `comment'.
It is up to the `forward-THING' functions to each DTRT, or else they break
`thing-at-point'. The alternative is to prevent `b-o-t-a-p' from relying on
`forward-comment'.
IOW, either (a) we need to fix `forward-comment' to DTRT in this case, (b) we
need to add a function `bounds-of-comment-at-point' and then (put 'comment
'bounds-of-thing-at-point 'bounds-of-comment-at-point), or (c) we need to define
adequate `beginning-op' and `end-op' functions for type `comment'.
(b) and (c) are the only ways that `bounds-of-thing-at-point' will avoid
(mis)using a `forward-THING' that does not DTRT for thing-at-point.
This bug report was last modified 14 years and 62 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.