あー
あー、すみません。多分、default-directory を care していないせいだと思います。
追記
こうかな。サブアカウント持っていないし、はてなグループにも参加していないので動作確認できないですけど。
というか、なんか良く見たらプロセスの停止部分がおかしいのでついでに修正。
Index: simple-hatena-mode.el =================================================================== --- simple-hatena-mode.el (revision 568) +++ simple-hatena-mode.el (working copy) @@ -459,8 +459,9 @@ (defun simple-hatena-internal-do-submit (&optional flag) "はてなダイアリ/グループへ日記を投稿する。" - (let ((max-mini-window-height 10)) ; hw.plが表示するメッセージを、 + (let ((max-mini-window-height 10) ; hw.plが表示するメッセージを、 ; echoエリアに表示させるため。 + (thisdir (file-name-directory (buffer-file-name)))) (run-hooks 'simple-hatena-before-submit-hook) (when (buffer-modified-p) (save-buffer)) @@ -469,17 +470,19 @@ (proc (get-buffer-process buffer))) (if (and proc - (eq (process-status proc) 'run) - (yes-or-no-p (format "A %s process is running; kill it?" - (process-name proc)))) - (progn - (interrupt-process proc) - (sit-for 1) - (delete-process proc))) + (eq (process-status proc) 'run)) + (if (yes-or-no-p (format "A %s process is running; kill it?" + (process-name proc))) + (progn + (interrupt-process proc) + (sit-for 1) + (delete-process proc)) + (error nil))) (with-current-buffer buffer (progn (erase-buffer) - (buffer-disable-undo (current-buffer)))) + (buffer-disable-undo (current-buffer)) + (setq default-directory thisdir))) (make-comint-in-buffer "simple-hatena-submit" buffer shell-file-name nil shell-command-switch (simple-hatena-internal-build-command flag))
ちなみにやっていることはたいしたことなくて
- プロセス用のバッファを用意
- すでにプロセスが実行されている場合はプロンプトを出してプロセスを停止するかどうか聞く
- 停止しないなら処理停止
- 処理用バッファの内容を削除
- make-comint-in-buffer で プロセス生成
- 生成したプロセスに sentinel(シグナルハンドラみたいなもの) を設定
って感じかな。