GNU bug report logs -
#8634
24.0.50; `number-at-point' returns char value for `?' constructs - 1) doc, 2) new fns
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Sat, 7 May 2011 15:31:02 UTC
Severity: minor
Tags: fixed
Found in version 24.0.50
Fixed in version 26.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Sat, 08 Feb 2014 22:45:02 -0800
> Cc: 8634 <at> debbugs.gnu.org
>
> "Drew Adams" <drew.adams <at> oracle.com> writes:
>
> > `number-at-point' is defined like this:
> >
> > (defun number-at-point ()
> > "Return the number at point, or nil if none is found."
> > (form-at-point 'sexp 'numberp))
> >
> > That uses `read-from-string' for the sexp at point, and testing whether the
> > result is `numberp'.
> >
> > That's fine, I guess, but it means that with buffer text such as ?A or ?\A-\^@
> > you get a non-nil result: the character value (wholenump) for ?A, which is 65,
> > and 4194304, respectively. If you are depending on code to find _numerals_ in
> > text and return their numeric values then this is not what you want. In that
> > case, you want a function that returns nil when point is not on a numeral.
>
> Looks like this is fixed now.
Are you saying that "M-: (number-at-point) RET" with point at ?A says
"nil"?
This bug report was last modified 8 years and 167 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.