ココを見つけた。
カレントバッファがファイルを持ってないときは xyzzy.exe があるフォルダを開くのはいいアイデアだと思った。
ちょっとだけ変更させてもらった。
- カレントバッファがファイルのときは、エクスプローラで開いたとき、そのファイルを選択
- M-x e で実行
(defun open-explorer (fn) (flet ((get-arg () (if fn (concat "/e,/select," (map-slash-to-backslash fn)) (concat "/e," (map-slash-to-backslash (si:system-root)))))) (call-process (concat (get-windows-directory) "explorer " (get-arg))))) (defun e () (interactive) (let ((fn (get-buffer-file-name))) (cond ((null fn) (open-explorer nil)) ((file-exist-p fn) (open-explorer fn)) (t (message "not exist ~A" fn)))))
レキシカルスコープの使い方は間違ってないと思うけど、どうだろう。
参考URL: