如何在 Ubuntu 中的 .emacs.el 中设置默认字体 (Inconsolata)?

发布于 2024-09-28 02:39:28 字数 645 浏览 0 评论 0原文

我尝试遵循从谷歌搜索收集的建议,但我无法让它发挥作用。我的 ~/.emacs.el 文件包含以下内容:

;; Set color scheme
(require 'color-theme)
(load-file "/home/manoj/Dropbox/conf/themes/color-theme-chocolate-rain.el")
(color-theme-chocolate-rain)

;; Set font
;; (set-default-font "-unknown-Inconsolata-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")

;; Insert four spaces on tab
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)

我已注释掉字体配置行,因为它不起作用。我在 palmer 上使用 2009-09-27 的 GNU Emacs 23.1.50.1 (i486-pc-linux-gnu, GTK+ Version 2.18.0),由 Ubuntu Karmic 上的 Debian 修改。

I tried following the advice gathered from Google searches but I am not able to get it to work. My ~/.emacs.el file contains the following:

;; Set color scheme
(require 'color-theme)
(load-file "/home/manoj/Dropbox/conf/themes/color-theme-chocolate-rain.el")
(color-theme-chocolate-rain)

;; Set font
;; (set-default-font "-unknown-Inconsolata-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")

;; Insert four spaces on tab
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)

I've commented out the font configuration line as it doesn't work. I'm using GNU Emacs 23.1.50.1 (i486-pc-linux-gnu, GTK+ Version 2.18.0) of 2009-09-27 on palmer, modified by Debian on Ubuntu Karmic.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

违心° 2024-10-05 02:39:28

从 emacs 版本来看,您似乎已经安装了 emacs-snapshot (很好)。

所以这应该可行:

sudo apt-get install ttf-inconsolata

然后放入 ~/.emacs 文件中

(set-frame-font "Inconsolata-12")

(12 指字体大小,可以更改。)

Judging from the emacs version, it appears you've installed emacs-snapshot (good).

So this should work:

sudo apt-get install ttf-inconsolata

Then put in your ~/.emacs file something like

(set-frame-font "Inconsolata-12")

(The 12 refers to the font size, and can be changed.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文