.xyzzy

(load-library "winkey")

; インクリメンタルサーチ
(require "isearch")

; ページダウン
(global-set-key #\M-n 'next-page)

; grep
(global-set-key '(#\C-c #\g) 'grep-dialog)

; diff
(global-set-key '(#\C-c #\d) 'diff)

; html+-mode
(export 'ed::html+-mode "ed")
(autoload 'html+-mode "html+-mode" t)
(pushnew '("\\.s?html?$" . html+-mode) *auto-mode-alist* :test 'equal)

; c-mode
(defvar c-indent-level 4)
(defvar c-continued-statement-offset 4)
(defvar c-argdecl-indent 0)
(defvar c-brace-offset -4)
(defvar c-brace-imaginary-offset 0)
(defvar c-label-offset -4)

; paren 括弧の対応
(require "paren")
(turn-on-global-paren)

; 選択
(global-set-key '(#\M-e) 'start-selection-as-region)

; 選択
(global-set-key '(#\M-j) 'start-selection-as-line)


; buffer
(global-set-key '(#\M-o) 'select-buffer)

;IME のトグル
(global-set-key #\C-o 'toggle-ime)

;; 一発でインデント
(defun indent-current-buffer () 
(interactive) 
(indent-region (point-min) (point-max)) 
(message "indent buffer")) 
(global-set-key #\C-F8 'indent-current-buffer)

;; c-mode 関数一覧
(global-set-key '(#\C-c #\l) 'list-function)

; next-page
(global-set-key #\M-n 'next-page)

; previous-page
(global-set-key #\M-p 'previous-page)

; repeat-complex-command
(global-set-key #\M-k 'repeat-complex-command) 


;ruby-mode 雪見酒版
(load-library "ruby-mode")
(push '("\\.rb$" . ruby-mode) *auto-mode-alist*)
; インデント量を変える。nilの時はタブを挿入
(setq *ruby-indent-column* 2)

; 服部版のruby-mode のデバッグと 雪見酒版のruby-mode の共存は可能?
; tags はxy のがそのまま使える。本当に??
; 今のところ、必要なのは、debug だけかな?
; ruby-debug.l の requre のrubyをruby-mode に書き換えた。一応、動いた
; のを確認。
(load-library "ruby-debug") ;debugモードを使うなら 

;; howm
(pushnew (merge-pathnames "site-lisp/howm/" (si:system-root))
                 *load-path* :test #'string-equal)
(require "howm-wrap")
;; `howm-init.l' をコピーしてない場合、以下を有効に。
;; 日本語メニューを使う。
;(setq elisp-lib::howm-menu-lang 'elisp-lib::ja)
;; howm end


;; calendar
(global-set-key '(#\C-c #\C-a) 'calendar)

(require "ni/setup")
;; 自動設定を利用する
(ni-autoload)

;netinstraller サイト一覧更新
(defun ni::add-site-from-wiki ()
  (interactive)
  (flet ((makeaddurl ()
	   (let (str s out)
	     (setq s (ni::http-get-url "http://xyzzy.s53.xrea.com/wiki/index.php?cmd=source&page=NetInstaller%2F%C7%DB%C9%DB%A5%D1%A5%C3%A5%B1%A1%BC%A5%B8%B0%EC%CD%F7"))
	     (setq str
		   (with-output-to-string (out)
		     (while
			 (ignore-errors
			  (format out "~A\n"(read-line s))
			  t))))
	     (dolist (i (split-string str "\n"))
	       (and (string-match "^:[^|]+|\\(http:.*\\)$" i)
		    (setq out (cons (match-string 1) out))))
	     out))
	 (makesiteurl ()
	   (ni::load-site-data)
	   (let (srclist)
	     (dolist (i ni::*site-data*)
	       (setq srclist (cons (cdr (assoc "src" i :test 'string=)) srclist)))
	     srclist)))
    (let (lis)
      (setq lis (makesiteurl))
      (dolist (i (makeaddurl))
	(unless (member i lis :test 'string=)
	  (ni::site-add i))))))
 ;;ここがキーバインド
(define-key ni::*site-map* #\N 'ni::add-site-from-wiki)


;;php-mode
(load-library "php-mode")
(pushnew '("\\.php$" . php-mode) *auto-mode-alist*)
(pushnew '("\\.inc$" . php-mode) *auto-mode-alist*)
;; php-miscを使う場合
(load-library "php-misc")
(setq *php-html-help-path* "C:/xyzzy/etc/php_manual_ja.chm")

grep ダイアログが憎かった。xkeymacs との連携

xyzzygrep のダイアログで、タブキーで、「パターン」「ファイル名」「ディレクトリ」を移動した直後は、文字が反転した状態になっています。

このとき、文字の内容を後ろから変えようとC-f をしても反転状態のまま変わらず、結局カーソルキーの右を押してました。一度、反転状態さえ抜ければ、C-f、C-b も普通に使用できます。
このかゆいところに手が届かない感じがすごく気持ち悪かったのですが、解決しました。


私は、xkeymacs を使用しているのですが、xyzzy を使用しているときは、必要ないのと動きがおかしくなるかも、と思って無効にしていました。


xyzzygrep ダイアログの文字の反転状態をC-f で抜けられるようにするには、下の二点をxkeymacs に設定します。

  1. xkeymacs で、xyzzy 独自の設定にするようにして、「ダイアログにはダイアログ専用の設定を利用する」にチェックをします。xyzzy 独自の設定で、キーバインドの設定は必要ないので、キーバインドのチェックをすべてクリアにしてあります。
  2. ダイアログ専用の設定で、カーソル移動系のキーバインドにチェックを入れます。(私は、それ加えてIME切り替えにもチェックしてありますが、今回の件とは関係ありません。)