From 8634b66adade09d77093bbacba3d35a84d47e029 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 10 May 2001 03:29:19 +0000 Subject: [PATCH] (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. --- lisp/eshell/esh-arg.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el index 77db1bfc100..0b68bd69a0a 100644 --- a/lisp/eshell/esh-arg.el +++ b/lisp/eshell/esh-arg.el @@ -52,7 +52,10 @@ yield the values intended." (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 -- 2.39.5