Skip to content

Commit

Permalink
(eshell-parse-argument-hook): If a number is encountered as an
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jwiegley committed May 10, 2001
1 parent 8051993 commit 7af6e48
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion esh-arg.el
Expand Up @@ -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
Expand Down

0 comments on commit 7af6e48

Please sign in to comment.