在Emacs中,如何在带有字体表面属性的minibuffer中显示消息? [英] In Emacs, how do I display a message in the minibuffer with font face properties?

查看:147
本文介绍了在Emacs中,如何在带有字体表面属性的minibuffer中显示消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在minibuffer中显示一个彩色字符串的文本,但是当我使用'message'功能时,文本属性被删除。解决方案

适用于我:

 (消息%s(正确的foo '(:foregroundred)))

你可能有 (propertize ...)),它将属性化的字符串解释为格式控制字符串,因此剥离了其属性。


I want to display a colored string of text in the minibuffer, but when I use the 'message' function, the text-properties of are stripped.

解决方案

Works for me:

(message "%s" (propertize "foo" 'face '(:foreground "red")))

You probably had (message (propertize ...)), which interprets the propertized string as a format control string, hence stripped of its properties.

这篇关于在Emacs中,如何在带有字体表面属性的minibuffer中显示消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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