【问题标题】:How to set a part of arguments from a list in Emacs Lisp?如何从 Emacs Lisp 的列表中设置部分参数?
【发布时间】:2011-09-14 04:09:09
【问题描述】:

我想从列表中设置PROGRAM-ARGSstart-process

喜欢,

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

但这会产生“...不是字符串”的错误,因为 start-process 只接受字符串参数。

我该如何解决这个问题?

【问题讨论】:

  • 请按原样复制和粘贴完整的错误。
  • start-process 显示真实 参数而不是foobarsome-args"the" "other" "arg" 有什么难的?

标签: list emacs lisp elisp


【解决方案1】:

您需要apply 或有时需要funcall。在这种特殊情况下,我会选择apply,但您需要熟悉它们。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-31
    • 2015-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多