gnyognyo.el を Emacs 22 以降で動かすために必要な事はすべて幼稚園の砂場で学んだ
Yuuji's software library の gnyognyo は、1999 年のプログラムなので、そのままでは Emacs 22 上で動きません。buffer-flush-undo を buffer-disable-undo に書き換える必要があります。
また、.Xdefaults で Emacs*lineSpacing: 2 のように行間の隙間を設定していると、X window system 上で Emacs を起動したときに window-height が返す値がおかしくなり、フィールドの位置が表示領域からずれるので、適当に調節します。
gnyo:bottom-edge-y (- (window-height) 3))
↓
gnyo:bottom-edge-y (if (eq window-system 'x) (- (/ (* (window-height) 8) 9) 3) (- (window-height) 3)))
あと、プロポーショナルフォントでやると面白いことになるので、フォントはプロポーショナルフォントにしましょうフォントは等幅フォントにしましょう。
以下は変更点をまとめたパッチ。
--- gnyognyo.el.orig 1999-09-14 12:53:37.000000000 +0900 +++ gnyognyo.el 2011-12-05 01:01:52.550210584 +0900 @@ -475,7 +475,10 @@ (/ (- (window-width) (* gnyo:width gnyo:char-width) gnyo:wall-width) 2) gnyo:right-edge-x (+ gnyo:left-edge-x (* gnyo:width gnyo:char-width) gnyo:wall-width) - gnyo:bottom-edge-y (- (window-height) 3)) + gnyo:bottom-edge-y + (if (eq window-system 'x) + (- (/ (* (window-height) 8) 9) 3) + (- (window-height) 3))) (let ((y 1) (w (window-height))) (while (< y w) (insert-char ? (1- (window-width))) (newline) (setq y (1+ y)))) @@ -849,7 +852,7 @@ (open-network-stream "*gnyoserv*" buffer host (or port gnyo:port)))) (set-buffer buffer) - (buffer-flush-undo (current-buffer)) + (buffer-disable-undo (current-buffer)) (erase-buffer) (while (not (memq (process-status gnyo:server-process) '(open run))) (message "Waiting for server to accept...") @@ -1476,7 +1479,7 @@ (or arg (setq gnyo:save-config (current-window-configuration))) (delete-other-windows) (switch-to-buffer (get-buffer-create gnyo:buffer)) - (buffer-flush-undo (current-buffer)) + (buffer-disable-undo (current-buffer)) (setq major-mode 'gnyognyo mode-name "ぐにょぐにょ") (use-local-map gnyo:key-map) (gnyo*init-value)