changeset 37656:e108dfe2ea99

(eshell-parse-argument-hook): If a number is encountered as an argument, don't convert it right away, but tag the first character of the string with the text properties `number', which signifies to `eshell-lisp-command' that the argument should be passed through `string-to-number' if it is actually used in the call to a Lisp function.
author John Wiegley <johnw@newartisans.com>
date Thu, 10 May 2001 03:29:19 +0000
parents dbce347b20da
children 4dc446a29001
files lisp/eshell/esh-arg.el
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/eshell/esh-arg.el	Thu May 10 03:29:06 2001 +0000
+++ b/lisp/eshell/esh-arg.el	Thu May 10 03:29:19 2001 +0000
@@ -52,7 +52,10 @@
 		 (looking-at eshell-number-regexp)
 		 (eshell-arg-delimiter (match-end 0)))
 	(goto-char (match-end 0))
-	(string-to-number (match-string 0)))))
+	(let ((str (match-string 0)))
+	  (if (> (length str) 0)
+	      (add-text-properties 0 1 '(number t) str))
+	  str))))
 
    ;; parse any non-special characters, based on the current context
    (function