Nxhtml Mode でコードを埋め込まれた HTML のハイライトを変更する。
Emacs で jsp や erb のようなプログラムコードの断片を内部に有する HTML のシンタックスハイライトをするには Nxhtml Mode が有用である。ただし、デフォルトのまま jsp や erb のファイルを開くとかなりキツイ配色になってしまう。そこで配色を変更するパッチを書いた。
--- a/util/mumamo.el +++ b/util/mumamo.el @@ -707,16 +707,16 @@ be colored, etc." (defface mumamo-background-chunk-major '((((class color) (min-colors 88) (background dark)) ;;:background "blue3") - :background "midnight blue") + :background "black") (((class color) (min-colors 88) (background light)) ;;:background "lightgoldenrod2") :background "cornsilk") (((class color) (min-colors 16) (background dark)) - :background "blue4") + :background "dark slate gray") (((class color) (min-colors 16) (background light)) :background "cornsilk") (((class color) (min-colors 8)) - :background "blue") + :background "dark slate gray") (((type tty) (class mono)) :inverse-video t) (t :background "gray")) @@ -728,16 +728,16 @@ interfere with syntax highlighting." (defface mumamo-background-chunk-submode1 '((((class color) (min-colors 88) (background dark)) ;;:background "blue3") - :background "dark green") + :background "dark slate gray") (((class color) (min-colors 88) (background light)) ;;:background "lightgoldenrod2") :background "azure") (((class color) (min-colors 16) (background dark)) - :background "blue3") + :background "blue4") (((class color) (min-colors 16) (background light)) :background "azure") (((class color) (min-colors 8)) - :background "blue") + :background "blue3") (((type tty) (class mono)) :inverse-video t) (t :background "gray")) @@ -749,16 +749,16 @@ interfere with syntax highlighting." (defface mumamo-background-chunk-submode2 '((((class color) (min-colors 88) (background dark)) ;;:background "blue3") - :background "dark green") + :background "dark slate gray") (((class color) (min-colors 88) (background light)) ;;:background "lightgoldenrod2") :background "#e6ff96") (((class color) (min-colors 16) (background dark)) - :background "blue3") + :background "blue4") (((class color) (min-colors 16) (background light)) :background "azure") (((class color) (min-colors 8)) - :background "blue") + :background "blue3") (((type tty) (class mono)) :inverse-video t) (t :background "gray")) @@ -770,17 +770,17 @@ interfere with syntax highlighting." (defface mumamo-background-chunk-submode3 '((((class color) (min-colors 88) (background dark)) ;;:background "blue3") - :background "dark green") + :background "dark slate gray") (((class color) (min-colors 88) (background light)) ;;:background "lightgoldenrod2") :background "#f7d1f4") ;;:background "green") (((class color) (min-colors 16) (background dark)) - :background "blue3") + :background "blue4") (((class color) (min-colors 16) (background light)) :background "azure") (((class color) (min-colors 8)) - :background "blue") + :background "blue3") (((type tty) (class mono)) :inverse-video t) (t :background "gray")) @@ -792,16 +792,16 @@ interfere with syntax highlighting." (defface mumamo-background-chunk-submode4 '((((class color) (min-colors 88) (background dark)) ;;:background "blue3") - :background "dark green") + :background "dark slate gray") (((class color) (min-colors 88) (background light)) ;;:background "lightgoldenrod2") :background "orange") (((class color) (min-colors 16) (background dark)) - :background "blue3") + :background "blue4") (((class color) (min-colors 16) (background light)) :background "azure") (((class color) (min-colors 8)) - :background "blue") + :background "blue3") (((type tty) (class mono)) :inverse-video t) (t :background "gray"))
カラーパレット自体は util/hfy-cmap.el に定義されているらしい。配色を決定する util/mumamo.el を変更すればカスタマイズができるようだ。これでだいぶ目にやさしい配色になった。