Subject: RE: [External] : bug#54555: 28.0.91; number is not an accepted value for THING in bounds-of-thing-at-point

From: Drew Adams <[email-masked]>
Date: Thu, 24 Mar 2022 21:13:22 +0000

> 2. Insert the number "123" in any buffer (preferably, the current one,
>    "*scratch*")
> 3. Place the cursor on any digit in the number that was written in the
>    previous step
> 5. Evaluate this sexp (bounds-of-thing-at-point 'number) in a number.
> 
> Current result
> "nil" is returned
> Expected result
> The boundaries of the number should be returned.

Yeah, `bounds-of-thing-at-point' is still somewhat broken
- at least neglected.
____

If you use `thing-at-point+.el' then
(bounds-of-thing-at-point 'number) and similar just work.

https://www.emacswiki.org/emacs/download/thingatpt%2b.el

____

In this case, you can code a fix yourself, with just this
(or similar):

(defun my-bounds-of-number-at-point ()
  "Return the bounds of the number represented by the numeral at point.
Return nil if none is found."
  (and (number-at-point)  (bounds-of-thing-at-point 'sexp)))

(put 'number 'bounds-of-thing-at-point 'my-bounds-of-number-at-point)