Subject: bug#8634: 24.0.50; `number-at-point' returns char value for `?' constructs - 1) doc, 2) new fns

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 08 Feb 2014 22:45:02 -0800

"Drew Adams" <[email-masked]> 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.  Closing.  Please reopen if you're still
seeing this.

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