]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix number-at-point in lisp buffers
authorNicolas Richard <theonewiththeevillook@yahoo.fr>
Thu, 28 Apr 2016 10:38:38 +0000 (12:38 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 28 Apr 2016 10:38:38 +0000 (12:38 +0200)
* lisp/thingatpt.el (number-at-point): Don't say that things
like ?a are numbers in lisp mode buffers (bug#8634).

lisp/thingatpt.el

index 9920fa06d0c86893b8cdcdeb16973e3216159079..df5c52d4d618a9b6351fa121694a0244085e9a48 100644 (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 ()