in thingatpt.el:
;; The function bounds-of-thing-at-point finds the beginning and
end
;; positions by moving first forward to the end of the "thing",
and then
;; backwards to the beginning.
;;;;;;;
Also bounds-of-thing-at-point jumps to-and-fro, doing some
sanity check every time.
Suggest to jump first at the
beginning, as backward move might be slow.
Avoid to-and-fro, deliver tests instead, so first try will be
reliable or return nil.