29

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

4

3 回答 3

66

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

只需将其添加到您的~/.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)
于 2011-02-20T17:38:58.137 回答
17

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

于 2011-02-19T16:51:45.297 回答
10

不要手动向这些行添加任何内容——您的更改将在某些事件上被 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)
于 2015-06-30T10:15:03.817 回答