擅长:python、mysql、java
<p><code>shell-command</code>的文档建议您使用<code>call-process</code>进行编程:</p>
<pre class="lang-lisp prettyprint-override"><code>(call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS)
</code></pre>
<p>但是,您用<code>shell-command-to-string</code>编写的代码对我来说是有效的,<code>M-x bible-verse</code>。您需要修复无效的密钥序列才能使密钥绑定生效,但是:</p>
^{pr2}$
<p>以下是一个接受参数并将其传递给进程的版本:</p>
<pre class="lang-lisp prettyprint-override"><code>(defun bible-verse (book chapter verse)
(interactive "*sBook: \ns%s, chapter: \ns%s, chapter %s, verse: ")
(call-process "python" nil t t
"~/test.py" book chapter verse))
</code></pre>
<p>我使用了<code>(interactive)</code>中的<code>*</code>标志来拒绝在不可写的缓冲区中运行,并且演示了如何在提示时格式化先前的参数。在</p>