aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2001-05-10 03:29:19 +0000
committerJohn Wiegley2001-05-10 03:29:19 +0000
commit8634b66adade09d77093bbacba3d35a84d47e029 (patch)
treee6672a709e782d45ee26ae600eb936df5497a953
parentb2c102f30bac02db430e0d7e44eb9084adf40c98 (diff)
downloademacs-8634b66adade09d77093bbacba3d35a84d47e029.tar.gz
emacs-8634b66adade09d77093bbacba3d35a84d47e029.zip
(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.
-rw-r--r--lisp/eshell/esh-arg.el5
1 files changed, 4 insertions, 1 deletions
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."
52 (looking-at eshell-number-regexp) 52 (looking-at eshell-number-regexp)
53 (eshell-arg-delimiter (match-end 0))) 53 (eshell-arg-delimiter (match-end 0)))
54 (goto-char (match-end 0)) 54 (goto-char (match-end 0))
55 (string-to-number (match-string 0))))) 55 (let ((str (match-string 0)))
56 (if (> (length str) 0)
57 (add-text-properties 0 1 '(number t) str))
58 str))))
56 59
57 ;; parse any non-special characters, based on the current context 60 ;; parse any non-special characters, based on the current context
58 (function 61 (function