开发者

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.

However the one font I can't seem to change is the one used to display the Buffer Menu (i.e. when you CTRL+left-click on a buffer, you get a pop-up menu tha开发者_JAVA百科t lists all open buffers).

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. 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?

Otherwise, if it can't be done, how tricky is it to recompile emacs23 with Lucid rather than GTK support on Ubuntu? Can it be done easily with "apt-get source"?


I believe I have discovered the answer:

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.

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

Seems to work well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜