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

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

bug#24969: 26.0.50; number-at-point


From: Andreas Röhler
Subject: bug#24969: 26.0.50; number-at-point
Date: Sun, 20 Nov 2016 20:26:32 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0



On 20.11.2016 17:58, Drew Adams wrote:
In Emacs 25.1 (emacs -Q), `number-at-point' at either
the `-' or the `1' returns nil, for me.  And I do not
see why it should return a number.
With 25.1 I get nil, on 26.0.50 I'm getting -1. I believe this is
due to the fix in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24605
I see.  Dunno what I think about this.  I'd be interested to
hear more from Tino about this.  It clearly is not backward
compatible.  Whether it is an improvement or not, I'm not
sure, in this case.

I guess it depends on what a user would expect of a
"number-at-point" function.  A priori, I don't see why s?he
would expect a non-nil answer if the numeral is embedded in
text that does not delimit a numeral (e.g. non whitespace text).
But maybe it is OK.

Would we expect the same kind of behavior for `sexp-at-point'
if a sexp were not surrounded by chars that delimit a sexp?

In Lisp, at least, there is no number at point, in `foo-2'.
That is, the Lisp parser (reader) would never pick up the
`2' as a number here.

I'm partial to use of thingatpt for Lisp, but I realize that
it is used in other contexts too.

In use here for edit-purposes.
For example raise all numbers in a region - makes it easier sometimes to adapt stuff, which doesn't deserve an own template.

Have a first implementation with ar-add-numbers in https://github.com/andreas-roehler/werkstatt/blob/master/misc/misc-utils.el - just re-writing it.










reply via email to

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