2010/05/22

Emacs custom-set-faces

custom-set-faces のことを知りませんでした。お陰様で、quack.el のシンタックスハイライトを変更したかったとき、quack.el を直に修正しましたよ・・・。

.emacs 編集時(lisp-mode?)の、コメントは斜体ですよね。それを変更しました。
(custom-set-faces
'(font-lock-comment-face ((t (:italic nil :foreground "slate gray")))))
view raw custom-lisp.el hosted with ❤ by GitHub


そこで、quack.el のことを思い出してのぞいて見たら同じことができるようだったので、そうしました。
;; custom faces
;; quack-pltish-comment-face
;; quack-pltish-selfeval-face
;; quack-pltish-paren-face
;; quack-banner-face
;; quack-pltish-class-defn-face
;; quack-pltish-module-defn-face
;; quack-pltish-keyword-face
;; quack-threesemi-h2-face
;; quack-threesemi-h3-face
;; quack-pltfile-prologue-face
;; quack-pltfile-dir-face
;; quack-pltfile-file-face
;; quack-about-title-face
;; quack-about-face
;; quack-smallprint-face
(custom-set-faces
'(quack-pltish-defn-face
((((class color) (background light))(:bold t :foreground "darkgoldenrod4"))
(((class color) (background dark))(:bold t :foreground "darkgoldenrod3"))
(t (:bold t :underline t)))))
(custom-set-faces
'(quack-threesemi-semi-face
((((class color) (background light))(:bold t :foreground "blue"))
(((class color) (background dark))(:bold t :foreground "blue"))
(t (:slant italic)))))
(custom-set-faces
'(quack-threesemi-text-face
((((class color) (background light))(:foreground "cyan4"))
(((class color) (background dark))(:bold t :foreground "blue"))
(t (:slant italic)))))
(custom-set-faces
'(quack-pltish-keyword-face
((((class color)(background light))(:bold t :foreground "maroon2"))
(((class color)(background dark))(:bold t :foreground "maroon2")))))
view raw custom-quack.el hosted with ❤ by GitHub


そういえば、auto-complete.el でもやってましたね。
(custom-set-faces
'(ac-candidate-face ((t (:background "dark orange" :foreground "white"))))
'(ac-selection-face ((t (:background "blue" :foreground "white")))))


何か一冊くらい Emacs の本が欲しいな。。

入門 GNU Emacs 第3版

2 件のコメント:

  1. 既にご存知かも知れませんが、ちょっとした変更なら set-face-* も手軽で便利です。
    (set-face-foreground 'font-lock-comment-face "coral")
    (set-face-italic-p 'font-lock-comment-face nil)

    返信削除
  2. 存じませんでした!ありがとうございます!
    こちらの方がすごくお手軽ですね・・・。

    返信削除