我的 .emacs 中的自定义设置变量和面孔是什么?

发布于 2024-10-18 16:45:23 字数 752 浏览 7 评论 0原文

这是在我的 .emacs 中,我可以修改它吗?

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(better-fringes-bitmap ((t (:foreground "#00dd44"))))
 '(font-lock-string-face ((((class color) (min-colors 88) (background light)) (:foreground "#113355")))))

到目前为止,我正在将我想要的所有内容添加到这些行之上......

this is in my .emacs can I mess with it or not?

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(better-fringes-bitmap ((t (:foreground "#00dd44"))))
 '(font-lock-string-face ((((class color) (min-colors 88) (background light)) (:foreground "#113355")))))

so far I am adding everything I want above these lines...

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

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

发布评论

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

评论(3

谁与争疯 2024-10-25 16:45:23

正如 Noufal 指出的,这些块是通过 customize 接口添加的。不过,如果您愿意,可以将它们移动到单独的文件中。

只需将其添加到您的 ~/.emacs.d/init.el 中:

(setq custom-file "~/.emacs.d/custom.el")
(load custom-file)

或者,如果您仍在使用 老式 ~/.emacs 文件:

(setq custom-file "~/.custom.el")
(load custom-file)

稍微有点在这两种情况下都适用的更复杂的片段是:

(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file)

These blocks are added by the customize interface, as Noufal pointed out. You can move them to a separate file, though, if you like.

Just add this to your ~/.emacs.d/init.el:

(setq custom-file "~/.emacs.d/custom.el")
(load custom-file)

or, if you're still using an old-fashioned ~/.emacs file:

(setq custom-file "~/.custom.el")
(load custom-file)

A slightly more complex snippet that will work in either case is:

(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file)
无法言说的痛 2024-10-25 16:45:23

这些是当您使用 customise 系统时添加到文件中的行。它们是在您使用 customize-* 时生成的。默认情况下,自定义选项存储在 .emacs 文件中。您通常不会手动编辑它们。您必须使用 customize-* 命令来编辑它们。

These are lines added to the file when you use the customise system. They're generated when you use customize-*. By default, the customisation options are stored in the .emacs file. You don't usually edit these by hand. You have to use the customize-* commands to edit them.

人生戏 2024-10-25 16:45:23

不要手动向这些行添加任何内容 - 在某些事件中,您的更改将被 emacs 消失。相反,使用 customize-set-variable 添加自定义变量,并使用 set-face-attribute 添加自定义外观:

(customize-set-variable 'blink-cursor-mode nil)
(set-face-attribute 'default nil :family "DejaVu Sans Mono")

为了自定义某些包的外观,有时需要先请求该包,然后设置它的脸:

(require 'mumamo)
(set-face-attribute 'mumamo-background-chunk-major nil :background nil)

Don't add anything to these lines manually — your changes will be vanished by emacs on some events. Instead add custom variables with customize-set-variable and custom faces with set-face-attribute:

(customize-set-variable 'blink-cursor-mode nil)
(set-face-attribute 'default nil :family "DejaVu Sans Mono")

In order to customize face of some package one sometimes need to request the package first, and after that set its face:

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