将字体设置为modeline的部分

saw*_*awa 5 emacs fonts themes elisp modeline

如何在模式行中使用多种字体?例如,如果想要它看起来像

线:23 尺寸:3000

LineSize在不同的字体比modeline字体,应该如何

(setq-default mode-line-format '(
    "Line: %l Size: %i"
))
Run Code Online (Sandbox Code Playgroud)

被修改?

Nic*_*ley 4

使用propertize。例如,要像您的示例中那样以粗体显示Line:和:Size:

(setq-default mode-line-format `(
    ,(propertize "Line:" 'face 'bold)
    " %l "
    ,(propertize "Size:" 'face 'bold)
    " %i"
))
Run Code Online (Sandbox Code Playgroud)

您可以用来M-x list-faces-display查看已定义面孔的示例,或定义您自己的面孔。

为了将来参考,您可以查看您尝试自定义的任何变量的文档C-h vmode-line-format提及使用的帮助propertize