diff --git a/lisp/simple.el b/lisp/simple.el index f79543058b..e17f2b0fc2 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1276,15 +1276,8 @@ goto-line-read-args (if (and current-prefix-arg (not (consp current-prefix-arg))) (list (prefix-numeric-value current-prefix-arg)) ;; Look for a default, a number in the buffer at point. - (let* ((default - (save-excursion - (skip-chars-backward "0-9") - (if (looking-at "[0-9]") - (string-to-number - (buffer-substring-no-properties - (point) - (progn (skip-chars-forward "0-9") - (point))))))) + (let* ((number (number-at-point)) + (default (and (natnump number) number)) ;; Decide if we're switching buffers. (buffer (if (consp current-prefix-arg)