Как изменить цвета переменного тока (автозаполнения) в dabbrev

#emacs #attributes #face

#emacs #атрибуты #Лицо

Вопрос:

Как изменить цвета переменного тока (автозаполнения) в dabbrev Я пытался изменить эти цвета в своем init.el

 (set-face-attribute 'ac-dabbrev-menu-face nil :inherit ac-candidate-face :foreground nil)
(set-face-attribute 'ac-dabbrev-selection-face nil :inherit ac-selection-face :background nil)
(set-face-attribute 'ac-etags-candidate-face nil :foreground nil)
(set-face-attribute 'ac-etags-selection-face nil :background nil)
  

Но это не сработало и выдало мне такую ошибку.
Пожалуйста, дайте мне знать, если есть способ сделать это.

PS: Я использую «monokai-theme», которая предоставляет грани ac-кандидата / selection-face

Ответ №1:

Предполагая, что вы используете новый API темы (вероятно), используйте custom-theme-set-faces . Я просто вставляю свои настройки, потому что мне лень тестировать с вашими. Я не совсем уверен, что делает установка атрибута nil .

   (load-theme 'calmer-forest 'noconfirm)
  (custom-theme-set-faces
   'calmer-forest

   '(ac-completion-face ((t (:foreground "green3"))))
   '(ac-selection-face ((t (:background "gray9" :foreground "magenta"))))
   '(ac-candidate-face ((t (:background "gray16" :foreground "lavender"))))
   '(ac-gtags-selection-face ((t (:inherit ac-selection-face))))
   '(ac-gtags-candidate-face ((t (:inherit ac-candidate-face))))
   '(ac-yasnippet-selection-face ((t (:inherit ac-selection-face))))
   '(ac-yasnippet-candidate-face ((t (:inherit ac-candidate-face))))
  ))