GNU bug report logs -
#54555
28.0.91; number is not an accepted value for THING in bounds-of-thing-at-point
Previous Next
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54555 in the body.
You can then email your comments to 54555 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54555
; Package
emacs
.
(Thu, 24 Mar 2022 20:38:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Rodrigo Morales <moralesrodrigo1100 <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 24 Mar 2022 20:38:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Actions that triggered the bug
1. Start Emacs with the flag -Q: $ emacs -Q
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.
Additional information
First, some context: The following sexp (thing-at-point 'number) is able
to get the number at point. For example, when the cursor is on any digit
of the following number: 123, that sexp returns "123".
One might think that the following sexp
(bounds-of-thing-at-point 'number)
returns the boundaries of the number at point. However, this doesn't
happen because "number" is not a recognized value for the THING
parameter in the function bounds-of-thing-at-point although "number" is
a recognized parameter in parameter with the same name THING in
thing-at-point.
Note that both thing-at-point and bounds-of-thing-at-point belong to the
same package: thingatpt.el
In GNU Emacs 28.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.31, cairo version 1.17.4)
of 2022-02-09 built on r1
Repository revision: d193801f59822554d28e497da146d982f5ab7995
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Arch Linux
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE
XIM XPM GTK3 ZLIB
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Memory information:
((conses 16 2520424 464021)
(symbols 48 74192 87)
(strings 32 512469 221518)
(string-bytes 1 17720034)
(vectors 16 236556)
(vector-slots 8 4539095 616527)
(floats 8 9916 1150)
(intervals 56 138426 14734)
(buffers 992 140))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54555
; Package
emacs
.
(Thu, 24 Mar 2022 21:14:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 54555 <at> debbugs.gnu.org (full text, mbox):
> 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)
Forcibly Merged 54553 54555.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 25 Mar 2022 14:12:02 GMT)
Full text and
rfc822 format available.
Forcibly Merged 54553 54555.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 25 Mar 2022 14:12:02 GMT)
Full text and
rfc822 format available.
Disconnected #54553 from all other report(s).
Request was from
Glenn Morris <rgm <at> fencepost.gnu.org>
to
control <at> debbugs.gnu.org
.
(Fri, 25 Mar 2022 15:31:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54555
; Package
emacs
.
(Fri, 25 Mar 2022 16:34:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 54555 <at> debbugs.gnu.org (full text, mbox):
Rodrigo Morales <moralesrodrigo1100 <at> gmail.com> writes:
> 1. Start Emacs with the flag -Q: $ emacs -Q
> 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.
I've now fixed this in Emacs 29.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug marked as fixed in version 29.1, send any further explanations to
54555 <at> debbugs.gnu.org and Rodrigo Morales <moralesrodrigo1100 <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 25 Mar 2022 16:34:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 23 Apr 2022 11:24:07 GMT)
Full text and
rfc822 format available.
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.