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

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sat, 7 May 2011 15:31:02 UTC

Severity: minor

Tags: fixed

Found in version 24.0.50

Fixed in version 26.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #48 received at 8634 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: 8634 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: 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
Nicolas Richard <theonewiththeevillook <at> yahoo.fr> 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




This bug report was last modified 8 years and 167 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.