From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#8634: 24.0.50; `number-at-point' returns char value for `?' constructs - 1) doc, 2) new fns Date: Thu, 28 Apr 2016 12:38:54 +0200 Message-ID: <87r3dqow5d.fsf@gnus.org> References: <458B95C58F7348C2AA62A340071C6E1C@us.oracle.com> <87lhxk7pjl.fsf@building.gnus.org> <83r47cuupv.fsf@gnu.org> <87fvnrzsjq.fsf@building.gnus.org> <83eh3bvdlh.fsf@gnu.org> <87iosnehy4.fsf@building.gnus.org> <444a1561-7d78-4d58-a2c3-8b4c7858071d@default> <87d2ivavqo.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1461839970 13872 80.91.229.3 (28 Apr 2016 10:39:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Apr 2016 10:39:30 +0000 (UTC) Cc: 8634@debbugs.gnu.org To: Nicolas Richard Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 28 12:39:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1avjLp-0003Di-AY for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Apr 2016 12:39:17 +0200 Original-Received: from localhost ([::1]:47868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avjLh-0000qs-G9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Apr 2016 06:39:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avjLb-0000mn-Lz for bug-gnu-emacs@gnu.org; Thu, 28 Apr 2016 06:39:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avjLa-0007IM-Jl for bug-gnu-emacs@gnu.org; Thu, 28 Apr 2016 06:39:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avjLa-0007IH-GC for bug-gnu-emacs@gnu.org; Thu, 28 Apr 2016 06:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1avjLa-0001ds-Bb for bug-gnu-emacs@gnu.org; Thu, 28 Apr 2016 06:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Apr 2016 10:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8634 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8634-submit@debbugs.gnu.org id=B8634.14618399396304 (code B ref 8634); Thu, 28 Apr 2016 10:39:02 +0000 Original-Received: (at 8634) by debbugs.gnu.org; 28 Apr 2016 10:38:59 +0000 Original-Received: from localhost ([127.0.0.1]:51262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avjLX-0001dc-Jm for submit@debbugs.gnu.org; Thu, 28 Apr 2016 06:38:59 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:34864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avjLV-0001dT-SE for 8634@debbugs.gnu.org; Thu, 28 Apr 2016 06:38:58 -0400 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1avjLS-0000hu-MH; Thu, 28 Apr 2016 12:38:56 +0200 In-Reply-To: <87d2ivavqo.fsf@yahoo.fr> (Nicolas Richard's message of "Mon, 10 Feb 2014 15:27:27 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) 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:117028 Archived-At: Nicolas Richard writes: > The following definition seems to fix that dependance (500 is arbitrary > choice -- the same arbitrary choice as for emails) : > > diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el > index 9a40049..7b4cf56 100644 > --- a/lisp/thingatpt.el > +++ b/lisp/thingatpt.el > @@ -581,7 +581,10 @@ Signal an error if the entire string was not used." > ;;;###autoload > (defun number-at-point () > "Return the number at point, or nil if none is found." > - (form-at-point 'sexp 'numberp)) > + (when (thing-at-point-looking-at "-?[0-9]+\\.?[0-9]*" 500) > + (string-to-number > + (buffer-substring (match-beginning 0) (match-end 0))))) > + > (put 'number 'thing-at-point 'number-at-point) > ;;;###autoload > (defun list-at-point () Thanks; applied to the trunk. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no