1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(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.
This commit is contained in:
John Wiegley 2001-05-10 03:29:19 +00:00
parent b2c102f30b
commit 8634b66ada

View file

@ -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