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: Lars Ingebrigtsen
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Nicolas Richard <address@hidden> 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





reply via email to

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