From: John Wiegley Date: Thu, 10 May 2001 03:50:53 +0000 (+0000) Subject: (eshell-lisp-command): Don't perform numeric conversions if a Lisp X-Git-Tag: emacs-pretest-21.0.104~555 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3cb27fd7cda5593e8924ec827ea00d7f0fbb83b2;p=emacs.git (eshell-lisp-command): Don't perform numeric conversions if a Lisp function has the property `eshell-no-numeric-conversions' set to a non-nil value. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 49e308f5ca7..59f24db3058 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2001-05-09 John Wiegley + * eshell/esh-util.el (eshell-convert-numeric-arguments): Annotated + the documentation string to tell users about + `eshell-no-numeric-conversions'. + * eshell/esh-cmd.el (eshell-lisp-command): Don't perform numeric conversions if a Lisp function has the property `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." name (getenv "PATH"))) (eshell-printn program))))) +(put 'eshell/which 'eshell-no-numeric-conversions t) + (defun eshell-named-command (command &optional args) "Insert output from a plain COMMAND, using ARGS. COMMAND may result in an alias being executed, or a plain command." @@ -1383,23 +1385,27 @@ messages, and errors." (defun eshell-lisp-command (object &optional args) "Insert Lisp OBJECT, using ARGS if a function." - ;; if any of the arguments are flagged as numbers waiting for - ;; conversion, convert them now - (let ((a args) arg) - (while a - (setq arg (car a)) - (if (and (stringp arg) - (> (length arg) 0) - (get-text-property 0 'number arg)) - (setcar a (string-to-number arg))) - (setq a (cdr a)))) - (setq eshell-last-arguments args - eshell-last-command-name "#") (catch 'eshell-external ; deferred to an external command (let* ((eshell-ensure-newline-p (eshell-interactive-output-p)) (result (if (functionp object) - (eshell-apply object args) + (progn + (setq eshell-last-arguments args + eshell-last-command-name + (concat "#")) + ;; if any of the arguments are flagged as numbers + ;; waiting for conversion, convert them now + (unless (get object 'eshell-no-numeric-conversions) + (while args + (let ((arg (car args))) + (if (and (stringp arg) + (> (length arg) 0) + (get-text-property 0 'number arg)) + (setcar a (string-to-number arg)))) + (setq args (cdr args)))) + (eshell-apply object eshell-last-arguments)) + (setq eshell-last-arguments args + eshell-last-command-name "#") (eshell-eval object)))) (if (and eshell-ensure-newline-p (save-excursion