简体   繁体   English

emacs23缓冲区菜单字体(GTK)

[英]emacs23 buffer menu font (GTK)

I've recently upgraded to emacs23 (Ubuntu 10.04) and I've managed to get my faces (fonts) all sorted out with relevant .emacs options. 我最近升级到了emacs23(Ubuntu 10.04),我设法让我的面孔(字体)全部用相关的.emacs选项整理出来。

However the one font I can't seem to change is the one used to display the Buffer Menu (ie when you CTRL+left-click on a buffer, you get a pop-up menu that lists all open buffers). 然而,我似乎无法更改的一种字体是用于显示缓冲区菜单的字体(即,当您按住CTRL +左键单击缓冲区时,您将获得一个列出所有打开缓冲区的弹出菜单)。

The problem is that the font used to display this menu is proportional (not fixed-width) and it makes a big mess of the menu - nothing is lined up vertically, and I often use this to see which buffers hold files that are in common directories. 问题是用于显示此菜单的字体是成比例的(不是固定宽度)并且它使菜单变得很乱 - 没有任何内容垂直排列,我经常使用它来查看哪些缓冲区保存了共同的文件目录。 The proportional font has the paths all over the place. 比例字体在整个地方都有路径。

I believe Ubuntu's emacs23 was built with GTK rather than Lucid. 我相信Ubuntu的emacs23是用GTK而不是Lucid构建的。 Some things I've read seem to indicate that there's no way to set this font within Emacs - that is has to be done externally using GTK config - if this is true, how? 我读过的一些东西似乎表明没有办法在Emacs中设置这个字体 - 这必须在外部使用GTK配置完成 - 如果这是真的,怎么样?

Otherwise, if it can't be done, how tricky is it to recompile emacs23 with Lucid rather than GTK support on Ubuntu? 否则,如果无法完成,使用Lucid重新编译emacs23而不是Ubuntu上的GTK支持是多么棘手? Can it be done easily with "apt-get source"? 可以使用“apt-get source”轻松完成吗?

I believe I have discovered the answer: 我相信我已经找到了答案:

http://www.gnu.org/software/emacs/manual/html_node/emacs/GTK-resources.html http://www.gnu.org/software/emacs/manual/html_node/emacs/GTK-resources.html

The idea is to create ~/.emacs.d/gtkrc and use the GTK config mechanism to set up alternative styles for emacs' GTK widgets. 我们的想法是创建〜/ .emacs.d / gtkrc并使用GTK配置机制为emacs的GTK小部件设置替代样式。

$ cat ~/.emacs.d/gtkrc
style "menufont"
{
  font_name = "monospace 10"  # Pango font name
}
widget "*emacs-menuitem*" style "menufont"

Seems to work well. 似乎运作良好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM