GNU bug report logs - #37458
27.0.50; number-at-point misses hex

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Thu, 19 Sep 2019 11:25:02 UTC

Severity: wishlist

Tags: fixed

Found in version 27.0.50

Fixed in version 27.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 37458 in the body.
You can then email your comments to 37458 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#37458; Package emacs. (Thu, 19 Sep 2019 11:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Röhler <andreas.roehler <at> easy-emacs.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 19 Sep 2019 11:25:02 GMT) Full text and rfc822 format available.

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

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; number-at-point misses hex
Date: Thu, 19 Sep 2019 13:18:51 +0200
number-at-point from thingatpt.el doesn't recognize hex-numbers.

Currently defined like that:

(defun number-at-point ()
  "Return the number at point, or nil if none is found."
  (when (thing-at-point-looking-at "-?[0-9]+\\.?[0-9]*" 500)
    (string-to-number
     (buffer-substring (match-beginning 0) (match-end 0)))))

Maybe make the regexp customizable?

Thanks,

Andreas

In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32)
 of 2019-09-12





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37458; Package emacs. (Fri, 20 Sep 2019 17:42:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 37458 <at> debbugs.gnu.org
Subject: Re: bug#37458: 27.0.50; number-at-point misses hex
Date: Fri, 20 Sep 2019 19:41:35 +0200
Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:

> number-at-point from thingatpt.el doesn't recognize hex-numbers.
>
> Currently defined like that:
>
> (defun number-at-point ()
> \240 "Return the number at point, or nil if none is found."
> \240 (when (thing-at-point-looking-at "-?[0-9]+\\.?[0-9]*" 500)
> \240\240\240 (string-to-number
> \240\240\240\240 (buffer-substring (match-beginning 0) (match-end 0)))))

(You have something odd in your emails -- it seems like leading spaces
are transformed into char 240.)

I've now changed this to recognise some hex numbers if they're preceded
by #x or 0x.  Just looking for "bare" hex numbers may return too many
false positives.

> Maybe make the regexp customizable?

That wouldn't help much since the string has to be transformed to a
number in the right base.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 20 Sep 2019 17:42:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 37458 <at> debbugs.gnu.org and Andreas Röhler <andreas.roehler <at> easy-emacs.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 20 Sep 2019 17:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37458; Package emacs. (Sun, 22 Sep 2019 15:41:02 GMT) Full text and rfc822 format available.

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

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 37458 <at> debbugs.gnu.org
Subject: Re: bug#37458: 27.0.50; number-at-point misses hex
Date: Sun, 22 Sep 2019 17:44:03 +0200
On 20.09.19 19:41, Lars Ingebrigtsen wrote:
> Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:
>
>> number-at-point from thingatpt.el doesn't recognize hex-numbers.
>>
>> Currently defined like that:
>>
>> (defun number-at-point ()
>> \240 "Return the number at point, or nil if none is found."
>> \240 (when (thing-at-point-looking-at "-?[0-9]+\\.?[0-9]*" 500)
>> \240\240\240 (string-to-number
>> \240\240\240\240 (buffer-substring (match-beginning 0) (match-end 0)))))
> (You have something odd in your emails -- it seems like leading spaces
> are transformed into char 240.)

Sent from thunderbird. Not visible here. Also don't get the error when 
copying back from previous mail.


>
> I've now changed this to recognise some hex numbers if they're preceded
> by #x or 0x.  Just looking for "bare" hex numbers may return too many
> false positives.

Thanks.


>> Maybe make the regexp customizable?
> That wouldn't help much since the string has to be transformed to a
> number in the right base.
>




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 21 Oct 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 242 days ago.

Previous Next


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