如何将字符串列表转换为elisp

时间:2017-08-13 13:30:35

标签: string loops emacs

高级目标是使用org-mode来处理包配置,使用相当格式化的列表作为字符串列表传入。 package-installed-ppackage-install都会带符号。

即:安装公司

(if (package-installed-p 'company)
    (print "yes")
    (print "no"))

会输出“是”

然后从字符串

(if (package-installed-p (intern "company"))
    (print "yes")
    (print "no"))

仍然输出“是”

好像我应该能够

(mapcar 'intern company)

获取列表中字符串定义的符号列表。 相反,我得到错误:'错误的类型参数:stringp,(“公司”)'

1 个答案:

答案 0 :(得分:0)

问题是字符串被包装在容器中。

(mapcar (lambda (x) (intern (car x))) packages)

似乎可以解决问题。