psgml にFaceを設定する方法

  • 手順

1. make-face Face を作成 (Face 名を宣言)
2. set-face-foreground Face を定義 (Face 名に対して色を定義)
3. sgml-markup-faces マークアップに Face を適用する
4. (setq sgml-set-face t) Face を有効にする。

既存のFaceをマークアップに適用する場合には、手順1.2.は不要。
Faceの一覧は、M-x list-faces-display で確認できる。

comment 注釈宣言
doctype 文書型宣言
end-tag 終了タグ
ignored 無視されたマーク区間
ms-start 無視されない場合,マーク区間終了
ms-end 無視されない場合,マーク区間開始
pi 処理命令
sgml SGML宣言
start-tag 開始タグ
entity 実体参照
shortref 短縮参照

  • 例(comment に対して Face 'sgml-comment-face' を作成し、foreground に、色 coral を適用する場合)

(make-face 'sgml-comment-face)
(set-face-foreground 'sgml-comment-face "coral")
(setq sgml-markup-faces '
(
(comment . sgml-comment-face)
)
)
(setq sgml-set-face t)