diff options
| author | John Wiegley | 2001-05-10 03:29:36 +0000 |
|---|---|---|
| committer | John Wiegley | 2001-05-10 03:29:36 +0000 |
| commit | 5aec6b055cb6b4b57386c484e4dc00cd9fe8a9f1 (patch) | |
| tree | 3756ff04a23b779e2d79fdf866f6a8f51f32ed83 | |
| parent | 8634b66adade09d77093bbacba3d35a84d47e029 (diff) | |
| download | emacs-5aec6b055cb6b4b57386c484e4dc00cd9fe8a9f1.tar.gz emacs-5aec6b055cb6b4b57386c484e4dc00cd9fe8a9f1.zip | |
(eshell-lisp-command): Before calling a Lisp function, convert any
string arguments that have been tagged as "numbers", by calling
string-to-number.
| -rw-r--r-- | lisp/eshell/esh-cmd.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 0b5cf0c8d26..fee5ea0c3c3 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el | |||
| @@ -1383,6 +1383,16 @@ messages, and errors." | |||
| 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 |