(defun eshell/pp2 (&rest r) (pp r))
(defun eshell/pp3 (&rest r)
(mapconcat #'(lambda (o) (if (stringp o) o (prin1-to-string o))) r " "))
$-> pp2 "a" 1 a1 -b "c d" d\ e
(#("a" 0 1
(escaped t))
1 "a1" "-b"
#("c d" 0 3
(escaped t))
#("d e" 1 2
(escaped t)))
$-> pp3 "a" 1 a1 -b "c d" d\ e
a 1 a1 -b c d d e
总是丢失了斜杠和引号信息。如何做才能:
(defun eshell/pp4 (&rest r) (do-something)) ;; <- 需要处理参数
$-> pp3 "a" 1 a1 -b "c d" d\ e
"a" 1 a1 -b "c d" d\ e
### 得到全部的输入
需求:把所有的输入转发到另外的程序执行,并且完全使用它的语法。 如
$-> z echo "123"
### 调用 zsh 的 echo "123" (保留引号和斜杠)