如何在Emacs Lisp中将列表转换为字符串 [英] How to convert list to string in Emacs Lisp

查看:333
本文介绍了如何在Emacs Lisp中将列表转换为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将列表转换为字符串,以便可以用它调用insertmessage?我需要显示c-offsets-alist,但插入时显示Wrong type argument: char-or-string-p或消息时显示Wrong type argument: stringp.

How can I convert a list to string so I can call insert or message with it? I need to display c-offsets-alist but I got Wrong type argument: char-or-string-p for insert or Wrong type argument: stringp for message.

推荐答案

我不确定您要实现的目标,但是format会将东西"转换为字符串.例如:

I am not sure of what you are trying to achieve, but format converts "stuff" to strings. For instance:

(format "%s" your-list)

将返回列表的表示形式. message在内部使用格式,所以

will return a representation of your list. message uses format internally, so

(message "%s" your-list)

将其打印

这篇关于如何在Emacs Lisp中将列表转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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