GNU bug report logs - #54555
28.0.91; number is not an accepted value for THING in bounds-of-thing-at-point

Previous Next

Package: emacs;

Reported by: Rodrigo Morales <moralesrodrigo1100 <at> gmail.com>

Date: Thu, 24 Mar 2022 20:38:01 UTC

Severity: minor

Found in version 28.0.91

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 54555 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Rodrigo Morales <moralesrodrigo1100 <at> gmail.com>, "54555 <at> debbugs.gnu.org"
 <54555 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#54555: 28.0.91; number is not an accepted value
 for THING in bounds-of-thing-at-point
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)




This bug report was last modified 3 years and 151 days ago.

Previous Next


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