Mercurial > emacs
comparison lisp/eshell/esh-cmd.el @ 37657:4dc446a29001
(eshell-lisp-command): Before calling a Lisp function, convert any
string arguments that have been tagged as "numbers", by calling
string-to-number.
author | John Wiegley <johnw@newartisans.com> |
---|---|
date | Thu, 10 May 2001 03:29:36 +0000 |
parents | b1c5785dbec5 |
children | cb20d33bef50 |
comparison
equal
deleted
inserted
replaced
37656:e108dfe2ea99 | 37657:4dc446a29001 |
---|---|
1381 "Evaluate FORM, trapping errors and returning them." | 1381 "Evaluate FORM, trapping errors and returning them." |
1382 (eshell-eval* 'eshell-printn 'eshell-errorn form)) | 1382 (eshell-eval* 'eshell-printn 'eshell-errorn form)) |
1383 | 1383 |
1384 (defun eshell-lisp-command (object &optional args) | 1384 (defun eshell-lisp-command (object &optional args) |
1385 "Insert Lisp OBJECT, using ARGS if a function." | 1385 "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)))) | |
1386 (setq eshell-last-arguments args | 1396 (setq eshell-last-arguments args |
1387 eshell-last-command-name "#<Lisp>") | 1397 eshell-last-command-name "#<Lisp>") |
1388 (catch 'eshell-external ; deferred to an external command | 1398 (catch 'eshell-external ; deferred to an external command |
1389 (let* ((eshell-ensure-newline-p (eshell-interactive-output-p)) | 1399 (let* ((eshell-ensure-newline-p (eshell-interactive-output-p)) |
1390 (result | 1400 (result |