aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Richard2016-04-28 12:38:38 +0200
committerLars Ingebrigtsen2016-04-28 12:38:38 +0200
commit786ab4a5ca0a326a1c2d44dcbfed8427f7783062 (patch)
tree56514a7f56db08f4429b82c0729b26c905cfc956
parent866e3c050fe64fee81f29a335a50a11b2562422e (diff)
downloademacs-786ab4a5ca0a326a1c2d44dcbfed8427f7783062.tar.gz
emacs-786ab4a5ca0a326a1c2d44dcbfed8427f7783062.zip
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).
-rw-r--r--lisp/thingatpt.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 9920fa06d0c..df5c52d4d61 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -603,7 +603,10 @@ Signal an error if the entire string was not used."
603;;;###autoload 603;;;###autoload
604(defun number-at-point () 604(defun number-at-point ()
605 "Return the number at point, or nil if none is found." 605 "Return the number at point, or nil if none is found."
606 (form-at-point 'sexp 'numberp)) 606 (when (thing-at-point-looking-at "-?[0-9]+\\.?[0-9]*" 500)
607 (string-to-number
608 (buffer-substring (match-beginning 0) (match-end 0)))))
609
607(put 'number 'thing-at-point 'number-at-point) 610(put 'number 'thing-at-point 'number-at-point)
608;;;###autoload 611;;;###autoload
609(defun list-at-point () 612(defun list-at-point ()