如何在Emacs Lisp中的列表中设置一部分参数? [英] How to set a part of arguments from a list in Emacs Lisp?

查看:62
本文介绍了如何在Emacs Lisp中的列表中设置一部分参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从列表中设置start-processPROGRAM-ARGS.

就像

(start-process process-name "*foobar*" process-path (append some-args (list (concat "the" "other" "arg"))))

但这会导致"...不是字符串"的错误,因为启动进程仅接受字符串参数.

But this makes error that "... is not string", because start-process accepts only string arguments.

我该如何解决?

推荐答案

您需要apply或有时是funcall.在这种情况下,我会选择apply,但是您需要对它们都熟悉.

You want either apply or sometimes funcall. In this particular case I would go with apply but you need to be familiar with them both.

(apply #'start-process process-name "*foobar*" process-path
       some-args other-args-as-a-list)

这篇关于如何在Emacs Lisp中的列表中设置一部分参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆