1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Fix number-at-point in lisp buffers

* lisp/thingatpt.el (number-at-point): Don't say that things
like ?a are numbers in lisp mode buffers (bug#8634).
This commit is contained in:
Nicolas Richard 2016-04-28 12:38:38 +02:00 committed by Lars Ingebrigtsen
parent 866e3c050f
commit 786ab4a5ca

View file

@ -603,7 +603,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 ()