;;;; ----------------------------------------------- ;;;; faces.el ;;;; font, 文字色などの設定 ;;;; ----------------------------------------------- ;;;; faceの探し方 ;; "M-x set-face-foreground" で faceを尋ねられるので "?" ;;;; 1. 外観 ;;; モードラインの色 (set-face-foreground 'modeline "gainsboro") (set-face-background 'modeline "navy") ;;; 選択中のリージョンの色 (set-face-background 'region "light blue") ;;; 余分のスペースやタブのハイライト (set-face-background 'trailing-whitespace "plum") ;;; 検索にマッチした文字列のハイライト (set-face-foreground 'isearch "white") (set-face-background 'isearch "blue") ;;; マウスカーソルの色 (set-face-background 'mouse "black") ;;;; 2. ハイライト関係 ;;; 2-1. global font lockを用いるか (setq font-lock-maximum-decoration t) (global-font-lock-mode t) ;;; 2-2. 各色の設定 (各モードに反映される) ;;; コメントの色 (set-face-foreground 'font-lock-comment-face "firebrick") ;;; 定数の色 (set-face-foreground 'font-lock-constant-face "red") ;;; 関数名の色とフォント (set-face-foreground 'font-lock-function-name-face "blue") (make-face-bold 'font-lock-function-name-face) ;;; キーワードの色 (set-face-foreground 'font-lock-keyword-face "forest green") (make-face-bold 'font-lock-keyword-face) ;;; 文字列(string)の色 (set-face-foreground 'font-lock-string-face "lightblue4") ;;; 変数の型の色 (set-face-foreground 'font-lock-type-face "royalblue1") ;;; 変数の色 (set-face-foreground 'font-lock-variable-name-face "gold4") ;;; 2-3. モードによって設定の微調整 ;;; 1. HTMLモード (defadvice html-mode (after tag-unbolding activate) (make-face-unbold 'font-lock-function-name-face) ;タグはボールドにしない ) ;;; 2. Makefileモード ;(require 'make-mode) ;(defvar makefile-mode-whitespace-font-lock-keywords ; '(("\t+" . font-lock-whitespace-face)) ; "Show Tab characters in Makefile mode") ;(setq makefile-font-lock-keywords ; (append makefile-font-lock-keywords ; makefile-mode-whitespace-font-lock-keywords)) ;;;; 3. 対応する括弧をハイライト表示する (show-paren-mode t) (setq show-paren-style 'mixed) ;; マッチした場合の色 (set-face-background 'show-paren-match-face "RoyalBlue1") (set-face-foreground 'show-paren-match-face "black") ;; マッチしていない場合の色 (set-face-background 'show-paren-mismatch-face "Red") (set-face-foreground 'show-paren-mismatch-face "black")