>> At the risk of veering off-topic (I mainly care about adding
>> 'bounds-of-thing-at-point-provider-alist' and
>> 'forward-thing-provider-alist'), would adding a new optional STRICT
>> argument to 'thing-at-point' and friends be an ok resolution for
>> everyone? This argument would enable Drew's proposed behavior. That way,
>> users get all the nice behavior by default just like today, and
>> programmers who require strict correctness in their code also have an
>> option.
>
> 1+ if STRICT means thing starting at point
> and without it we may need to look for the
> beginning of the thing (lazy point setting)....
Why "starting" at point? STRICT shouldn't mean
checking whether a THING starts at point.
The "strict" behavior that's needed is checking
_whether_ there is a THING at point, that is,
checking whether the char at point (which really
means just after point) is on/inside a THING.
That's for `bounds-of-thing-at-point' etc. For
thing-at-point etc., IF there's a THING at point
then that THING is the non-nil value returned.
In terms of implementation, I suggest you take
a look at the code in thingatpt+.el. Look at
functions `tap-bounds-of-thing-at-point' and
`tap-thing-at-point'. Just remove the `tap-'
prefix for code that DTRT. The file Commentary
explains things in detail.
My code adds an optional arg SYNTAX-TABLE, but
you need not bother with that. Elisp now has
`with-syntax-table', which can be used as a
workaround if there's no such argument.
In the end, `bounds-of-thing-at-point' and
`thing-at-point' should return nil if there's
no THING at the char at point.
For "lax" behavior that corresponds to the
current vanilla behavior, if the strict
behavior would return nil then they return
what the strict behavior would return at
(1- point).
But really such a lax behavior is pretty lame.
What's needed, for trying to grab a THING near
point is not just checking backward one char
but checking backward, forward, up, and down
N chars, where N determines what "near" means.
thingatpt+.el provides two user options,
`tap-near-point-x-distance' and
`tap-near-point-y-distance', the max number of
chars from point to check for a THING (for X:
left and right, for Y: up and down). Setting
the Y value to zero constrains search to the
same line as point.