From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas =?UTF-8?Q?R=C3=B6hler?= Newsgroups: gmane.emacs.bugs Subject: bug#24969: 26.0.50; number-at-point Date: Tue, 22 Nov 2016 09:45:01 +0100 Message-ID: <8130a1ef-b77d-b1df-3db7-8952a592e6aa@easy-emacs.de> References: <87fumm9uti.fsf@gmx.net> <2b644637-6ade-b00f-aa35-07c390fc92c7@easy-emacs.de> <87twb2jkzs.fsf@users.sourceforge.net> <87polp7ze2.fsf@gmail.com> <30945b58-5353-4475-92b3-7e276f20750e@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1479803837 27801 195.159.176.226 (22 Nov 2016 08:37:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2016 08:37:17 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 Cc: Stephen Berman , 24969@debbugs.gnu.org, npostavs@users.sourceforge.net To: Drew Adams , Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 22 09:37:11 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c96Zj-0005uh-Lj for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2016 09:37:11 +0100 Original-Received: from localhost ([::1]:54062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c96Zl-0002Pl-N1 for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2016 03:37:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c96Ze-0002PO-Hl for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 03:37:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c96Za-0005GE-Ex for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 03:37:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50591) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c96Za-0005Fz-C3 for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 03:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c96Za-0006bP-3p for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 03:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2016 08:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24969 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: unreproducible Original-Received: via spool by 24969-submit@debbugs.gnu.org id=B24969.147980380425356 (code B ref 24969); Tue, 22 Nov 2016 08:37:02 +0000 Original-Received: (at 24969) by debbugs.gnu.org; 22 Nov 2016 08:36:44 +0000 Original-Received: from localhost ([127.0.0.1]:37757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c96ZI-0006au-16 for submit@debbugs.gnu.org; Tue, 22 Nov 2016 03:36:44 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.131]:51575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c96ZG-0006ag-92 for 24969@debbugs.gnu.org; Tue, 22 Nov 2016 03:36:42 -0500 Original-Received: from [192.168.178.35] ([95.119.60.199]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Ldqv1-1caUso2vNz-00j0op; Tue, 22 Nov 2016 09:36:13 +0100 In-Reply-To: <30945b58-5353-4475-92b3-7e276f20750e@default> X-Provags-ID: V03:K0:5WHoQo8lXug4KmV6IeW3F8r2UTbIADUtBrnyTL5lu/Y3mjDLtuc n3Dcm4cs2tIEb1FDnSK0vXIpFcORUgLTrFOaQS41ePE21i5k8k1z8XqFHxxc2EKcHyv7yuf URGp+EydNZUdn2OMQx2v31KFm0fM9Z4dJ2Dd37bIz/midr7I0Ch+l+O5eNN1HCH1AcWHnbX M/btMNsdNx8yAhqOE+zRQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:LFLP8WTpaVE=:4xwJPc7WpWn8Sh1abLOtUt gI55PXUxBGVIj0QNzVnwVAR9FbMqMxc0Kbu/pteTHdWfGQ6Rq12L/zo+kfdylEhMfruTtdlPk +i+AFy5vdzrHtH9qyaF7qM5dinBg8LZCc2jUi3WAsc1JugB4Hw91riE8OcN1JVOHqkII1skSE kDp7rFklUCrRQax6X8ccY+a8Hg6SrSIklcoK3SjKmOa2uBslLt//UOOkKrn56jDmEOVnPY6Ig UzLzeNAN4RKuKPUav98Q4/AABZRqWySCVgT+qQGlAoRbKwgPiisM0e5t9GSA4NfXkZ3mVtvUh qWW3bdY9dJGbZWuDb4RsidZeetJSygQIJ4fwCM+z/KH582E/ZVTAu/hvfxyqnocNF+jmQgiZb WovzP4uyIxCRmLp/XYSPmOJ9LqTSBZnLeCfoHuBS+boQiuSRykRyoCFD8HT0m6ozaybKBUiZw fGSiQ3RyL2nztTxdbva4GEjOkjJGkrVtvxaGfq+1KUdit82hvIU1cBDFJIvvc/PIX6wDuTm0q fBnm0QcQxrd4n+l3RCAeUS9E0iGvVRUnBIf2+xzYM3L1FJJE1zoXFomitMPlKjdVsf8vgKcWc gQBsDCCu+6O2kaaR5UB3bepF/uU3r4nIT6LRFGFKn+MqkaIENT+VfZolEUYQTspaZvH7TymA8 LyMnGuJy9GO8p3kVGU1cM6wbkm0plZ28FiYNk/LqGRyDQbll5SI9/ROZNSnEPIp3B+rc5GJUM nP/3Ak9emDu+95i6QKfKOQAQsX+h2iXB06eBSg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:125980 Archived-At: On 22.11.2016 00:07, 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. >>> >>> `number-at-point' is defined using `form-at-point' with >>> THING `sexp' and predicate `numberp'. The sexp picked >>> up at point is `foo-1', and that fails `numberp'. >> From the time when i opened Bug#24605, the >> implementation, in master branch, of `number-at-point' >> was different: it changed in commit 786ab4a5 (Bug#8634). >> My patch was driven by this implementation. I didn't notice >> that `number-at-point' behaves different in emacs-25. > It behaves the same in Emacs 25.1 as previously. If something > broke this after Emacs 25.1 then it should be reverted. > >>> What am I missing? Why should this rightfully return >>> a number? I'm guessing that you are all using a more >>> recent version of `number-at-point' than what is in >>> Emacs 25.1 (?). But to me the Emacs 25.1 behavior I >>> see (i.e., returning nil) is correct. >>> >>> Did someone change the meaning of `number-at-point' >>> so that it now picks up a numeral that is not isolated? >>> If so, why would that be considered proper behavior? >>> At the very least it is not backward-compatible behavior. >> That's right. Commit above breaks backward-compatibility. > If it returns a number for point on a numeral in the middle > of a symbol name etc. then it breaks not only backward > compatibility - it breaks the very notion of a number at > point. A number at point should be a number as delimited > and distinguished in the current mode. > > The longstanding definition uses Lisp `read', so it distinguishes > a _Lisp_ number. It uses what Lisp uses to delimit a numeral. > > A better implementation of `number-at-point' than what has > always existed would do this: > > 1. Get (thing-at-point 'sexp) > 2. If it is not a string, return nil. > 3. Else match it against a regexp that tests for a numeral > in the current mode/context. Or use another such test > other than regexp matching. If there the mode/context > defines numeric syntax then perhaps use a function that > tests that way. > 4. For Lisp, the result must coincide with the longstanding > behavior, one way or another. > > Unless `number-at-point' is extended in such a way, it should > simply be restored to what it has always been. It's behavior > in Lisp should in any case be to return a Lisp number. > Why? A lisp-number is useful for further computations, for adding them for example. It's not useful when editing the numbers text at point. As (thing-at-point 'sexp) internally will get the buffer-substring with the number's literal, why not make is accessible for edits?