.emacs を eval-bufferできるように

フォントの設定を弄ってみたので,メモメモ。


はじめ,w32-fon-list が返してくるリストを,while と setq で,
ループしてたけど,なんかあるはずだと思い,some を見つけ,すっきり。
フォント名を変数にして,さらに関数にする方がよさそうだが。。。
これで,.emacs を弄って,M-x eval-buffer しても怒られないですむ。

(require 'cl)
;; MeiryoKeConConsolas 13 point
(when (not (some (lambda (x) (string-equal x "MeiryoKeConConsolas-13")) (w32-font-list)))
  (w32-add-font
   "MeiryoKeConConsolas-13"
   '((spec
      ((:char-spec ascii :height any)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 400 0 nil nil nil 128 1 3 49))
      ((:char-spec ascii :height any :weight bold)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 600 0 nil nil nil 128 1 3 49))
      ((:char-spec ascii :height any :slant italic)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 400 0 nil nil nil 128 1 3 49))
      ((:char-spec ascii :height any :weight bold :slant italic)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 600 0 nil nil nil 128 1 3 49))
      ((:char-spec katakana-jisx0201 :height any)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 400 0 nil nil nil 128 1 3 49))
      ((:char-spec katakana-jisx0201 :height any :weight bold)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 400 0 nil nil nil 128 1 3 49))
      ((:char-spec katakana-jisx0201 :height any :slant italic)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 400 0 t nil nil 128 1 3 49))
      ((:char-spec katakana-jisx0201 :height any :weight bold :slant italic)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 600 0 t nil nil 128 1 3 49))
      ((:char-spec japanese-jisx0208 :height any)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 400 0 nil nil nil 128 1 3 49))
      ((:char-spec japanese-jisx0208 :height any :weight bold)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 600 0 nil nil nil 128 1 3 49))
      ((:char-spec japanese-jisx0208 :height any :slant italic)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 400 0 t nil nil 128 1 3 49))
      ((:char-spec japanese-jisx0208 :height any :weight bold :slant italic)
       strict
       (w32-logfont "MeiryoKeConConsolas" 0 -13 600 0 t nil nil 128 1 3 49))))))