aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/eshell/esh-cmd.el32
2 files changed, 23 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 49e308f5ca7..59f24db3058 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12001-05-09 John Wiegley <johnw@gnu.org> 12001-05-09 John Wiegley <johnw@gnu.org>
2 2
3 * eshell/esh-util.el (eshell-convert-numeric-arguments): Annotated
4 the documentation string to tell users about
5 `eshell-no-numeric-conversions'.
6
3 * eshell/esh-cmd.el (eshell-lisp-command): Don't perform numeric 7 * eshell/esh-cmd.el (eshell-lisp-command): Don't perform numeric
4 conversions if a Lisp function has the property 8 conversions if a Lisp function has the property
5 `eshell-no-numeric-conversions' set to a non-nil value. 9 `eshell-no-numeric-conversions' set to a non-nil value.
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index fee5ea0c3c3..ef64fa95867 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -1265,6 +1265,8 @@ be finished later after the completion of an asynchronous subprocess."
1265 name (getenv "PATH"))) 1265 name (getenv "PATH")))
1266 (eshell-printn program))))) 1266 (eshell-printn program)))))
1267 1267
1268(put 'eshell/which 'eshell-no-numeric-conversions t)
1269
1268(defun eshell-named-command (command &optional args) 1270(defun eshell-named-command (command &optional args)
1269 "Insert output from a plain COMMAND, using ARGS. 1271 "Insert output from a plain COMMAND, using ARGS.
1270COMMAND may result in an alias being executed, or a plain command." 1272COMMAND may result in an alias being executed, or a plain command."
@@ -1383,23 +1385,27 @@ messages, and errors."
1383 1385
1384(defun eshell-lisp-command (object &optional args) 1386(defun eshell-lisp-command (object &optional args)
1385 "Insert Lisp OBJECT, using ARGS if a function." 1387 "Insert Lisp OBJECT, using ARGS if a function."
1386 ;; if any of the arguments are flagged as numbers waiting for
1387 ;; conversion, convert them now
1388 (let ((a args) arg)
1389 (while a
1390 (setq arg (car a))
1391 (if (and (stringp arg)
1392 (> (length arg) 0)
1393 (get-text-property 0 'number arg))
1394 (setcar a (string-to-number arg)))
1395 (setq a (cdr a))))
1396 (setq eshell-last-arguments args
1397 eshell-last-command-name "#<Lisp>")
1398 (catch 'eshell-external ; deferred to an external command 1388 (catch 'eshell-external ; deferred to an external command
1399 (let* ((eshell-ensure-newline-p (eshell-interactive-output-p)) 1389 (let* ((eshell-ensure-newline-p (eshell-interactive-output-p))
1400 (result 1390 (result
1401 (if (functionp object) 1391 (if (functionp object)
1402 (eshell-apply object args) 1392 (progn
1393 (setq eshell-last-arguments args
1394 eshell-last-command-name
1395 (concat "#<function " (symbol-name object) ">"))
1396 ;; if any of the arguments are flagged as numbers
1397 ;; waiting for conversion, convert them now
1398 (unless (get object 'eshell-no-numeric-conversions)
1399 (while args
1400 (let ((arg (car args)))
1401 (if (and (stringp arg)
1402 (> (length arg) 0)
1403 (get-text-property 0 'number arg))
1404 (setcar a (string-to-number arg))))
1405 (setq args (cdr args))))
1406 (eshell-apply object eshell-last-arguments))
1407 (setq eshell-last-arguments args
1408 eshell-last-command-name "#<Lisp object>")
1403 (eshell-eval object)))) 1409 (eshell-eval object))))
1404 (if (and eshell-ensure-newline-p 1410 (if (and eshell-ensure-newline-p
1405 (save-excursion 1411 (save-excursion