更改自定义设置面以在certian emacs模式下显示这些设置(文本模式,LaTeX模式等)

J S*_*pen 0 emacs customization elisp dot-emacs emacs-faces

我有一个自定义设置面,我曾在emacs启动文件中使用,特别是当我启动乳胶文件但我正在合并和更新我的.emacs文件,所以我没有启动单独启动乳胶文件的特写过程.我想设置它,以便仅在乳胶模式打开时设置此自定义面.因为它是一个自定义的面孔我不认为设置一个LaTeX模式钩子是明智的,但我知道应该有一种方法来做到这一点.我只是在输入时才更改字体和文本大小.如果可能的话,我也希望这能用于文本模式.附上下面的自定义面.

(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.
 '(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "DejaVu Sans")))))
Run Code Online (Sandbox Code Playgroud)

chr*_*hrm 9

您可以使用set-face-attribute设置自定义面,而不是自定义面,但它仍会在"所有缓冲区"中更改面.

(set-face-attribute 'default nil
 :inherit nil
 :stipple nil
 :background "white"
 :foreground "black"
 :inverse-video nil
 :box nil
 :strike-through nil
 :overline nil
 :underline nil
 :slant 'normal
 :weight 'normal
 :height 98
 :width 'normal
 :foundry "unknown"
 :family "DejaVu Sans")
Run Code Online (Sandbox Code Playgroud)

您应该识别正确的面并且只设置它们,不要设置默认值.为了确定这面点使用