bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8634: 24.0.50; `number-at-point' returns char value for `?' construc


From: Eli Zaretskii
Subject: bug#8634: 24.0.50; `number-at-point' returns char value for `?' constructs - 1) doc, 2) new fns
Date: Sun, 09 Feb 2014 18:17:00 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Sat, 08 Feb 2014 22:45:02 -0800
> Cc: 8634@debbugs.gnu.org
> 
> "Drew Adams" <drew.adams@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"?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]