为什么`shell-command-to-string`调用外部命令可以成功,而`process-lines`却失败了?

我是使用mutool命令提取pdf中的文档,但是运行(shell-command-to-string (format "mutool draw -Ftext %s" file-1))成功了,而运行(process-lines "mutool" "draw" "-Ftext" file-1)却失败了,mutool退出码为1,请问是什么原因?

看看是不是环境变量引起的?

第一个是用shell启动进程, 第二个函数是 call-process 启动的。

file-1定义的文件路径是以~起始的,似乎process-lines并不能将~解析为HOME路径。将~改为HOME路径就好了。