像错误调用函数的错误消息显示,例如:
(message (file-attributes "."))
产生消息:
"eval: Wrong type argument: stringp, ("/home14/tjones" 1 0 0 (20415 35598) (20211 19255) (20211 19255) 14 "lrwxrwxrwx" t ...)"
你如何有意地进行这种类型的翻译,例如:
(message (thing-to-string (file-attributes ".")))
要发送消息,例如:
("/home14/tjones" 1 0 0 (20415 35598) (20211 19255) (20211 19255) 14 "lrwxrwxrwx" t ...)
这仅用于调试/信息。我假设有一种方法可以让消息这样做,但这是否会暴露给我们用户?
最佳答案
调查prin1-to-string
和相关函数( prin1
、 princ
等)。并尝试使用手册! http://www.gnu.org/software/emacs/manual/html_node/elisp/Output-Functions.html
关于elisp - Emacs 口齿不清;如何从任何类型的变量创建一个字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10755677/